@streamorchard/grapevine 0.3.0 → 0.4.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/PROTOCOL.md
CHANGED
|
@@ -197,18 +197,18 @@ A capability is a named feature one app provides and others use, defined by a JS
|
|
|
197
197
|
|
|
198
198
|
What a drops app is farming, with enough for another app to show it, in a top-bar widget say. Provided by Pear Drops.
|
|
199
199
|
|
|
200
|
-
| Field |
|
|
201
|
-
| -------------- |
|
|
202
|
-
| `state` | `farming` (its player is watching a stream for drop credit), `waiting`, `paused`, `done`, `signed-out`, or one added later
|
|
203
|
-
| `account` | The account it farms for, or `null`
|
|
204
|
-
| `channel` | The channel it's watching while `farming` (with its `avatar`, optional), else `null`
|
|
205
|
-
| `stream` | Optional, while farming: `{ title?, viewers? }`
|
|
206
|
-
| `drop` | While farming, `{ campaign, category, progress }`, else `null`. Optional extras below
|
|
207
|
-
| `drop.image` | The category's picture
|
|
208
|
-
| `drop.endsAt` | When the drop ends
|
|
209
|
-
| `drop.rewards` | `{ claimed, total }`
|
|
210
|
-
| `drop.next` | The reward being worked towards: `{ name, image?, required, unlocksAt }`, where `required` is minutes and `unlocksAt` is when it should unlock at the current rate
|
|
211
|
-
| `drop.doneAt` | When every reward should be earned at the current rate, or `null`
|
|
200
|
+
| Field | |
|
|
201
|
+
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
202
|
+
| `state` | `farming` (its player is watching a stream for drop credit), `waiting`, `paused`, `done`, `signed-out`, or one added later |
|
|
203
|
+
| `account` | The account it farms for, or `null` |
|
|
204
|
+
| `channel` | The channel it's watching while `farming` (with its `avatar`, optional), else `null` |
|
|
205
|
+
| `stream` | Optional, while farming: `{ title?, viewers? }` |
|
|
206
|
+
| `drop` | While farming, `{ campaign, category, progress }`, else `null`. Optional extras below |
|
|
207
|
+
| `drop.image` | The category's picture |
|
|
208
|
+
| `drop.endsAt` | When the drop ends |
|
|
209
|
+
| `drop.rewards` | `{ claimed, total, items? }`. `items` lists every reward in the order they unlock (up to 20): `{ name, image?, required, state, unlocksAt? }`, where `state` is `claimed`, `ready` (unlocked, waiting to be claimed), `locked`, or one added later, and a locked one's `unlocksAt` is when it should unlock at the current rate |
|
|
210
|
+
| `drop.next` | The reward being worked towards: `{ name, image?, required, unlocksAt }`, where `required` is minutes and `unlocksAt` is when it should unlock at the current rate |
|
|
211
|
+
| `drop.doneAt` | When every reward should be earned at the current rate, or `null` |
|
|
212
212
|
|
|
213
213
|
`drops.farming.show {}` asks the drops app to bring its window to the front, for a click on that widget. It replies `{ shown }`.
|
|
214
214
|
|
package/README.md
CHANGED
|
@@ -66,7 +66,15 @@ link.publish('drops.farming.changed', {
|
|
|
66
66
|
progress: { done: 48, total: 120, unit: 'minutes' },
|
|
67
67
|
image: 'https://files.kick.com/…/neon-rush.webp',
|
|
68
68
|
endsAt: '2026-10-21T18:00:00Z',
|
|
69
|
-
rewards: {
|
|
69
|
+
rewards: {
|
|
70
|
+
claimed: 1,
|
|
71
|
+
total: 3,
|
|
72
|
+
items: [
|
|
73
|
+
{ name: 'Pear Badge', required: 30, state: 'claimed' },
|
|
74
|
+
{ name: 'Hype Rocket Emote', required: 60, state: 'locked', unlocksAt: '2026-10-18T09:24:00Z' },
|
|
75
|
+
{ name: 'Neon Crown', required: 120, state: 'locked', unlocksAt: '2026-10-18T10:24:00Z' },
|
|
76
|
+
],
|
|
77
|
+
},
|
|
70
78
|
next: { name: 'Hype Rocket Emote', required: 60, unlocksAt: '2026-10-18T09:24:00Z' },
|
|
71
79
|
doneAt: '2026-10-18T10:24:00Z',
|
|
72
80
|
},
|
|
@@ -144,10 +152,10 @@ Example messages for every capability version, good and bad, are in `@streamorch
|
|
|
144
152
|
|
|
145
153
|
## Capabilities
|
|
146
154
|
|
|
147
|
-
| Capability | Provided by | What it says
|
|
148
|
-
| ------------------- | ---------------- |
|
|
149
|
-
| `drops.farming` 1.0 | Pear Drops | Whether it's farming: the channel, stream and drop, with pictures
|
|
150
|
-
| `players` 1.0 | Stream Multiview | Its players by site: signed in or not, and which channels are open
|
|
155
|
+
| Capability | Provided by | What it says |
|
|
156
|
+
| ------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
157
|
+
| `drops.farming` 1.0 | Pear Drops | Whether it's farming: the channel, stream and drop, with pictures and every reward's state and when it unlocks, enough for a widget. Also `show`, to bring Pear Drops to the front |
|
|
158
|
+
| `players` 1.0 | Stream Multiview | Its players by site: signed in or not, and which channels are open |
|
|
151
159
|
|
|
152
160
|
To add one:
|
|
153
161
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"event": "drops.farming.changed",
|
|
3
|
+
"params": {
|
|
4
|
+
"seq": 1,
|
|
5
|
+
"at": "2026-10-18T09:12:04Z",
|
|
6
|
+
"state": "farming",
|
|
7
|
+
"account": null,
|
|
8
|
+
"channel": null,
|
|
9
|
+
"drop": {
|
|
10
|
+
"campaign": "c",
|
|
11
|
+
"category": "c",
|
|
12
|
+
"progress": { "done": 1, "total": 2, "unit": "minutes" },
|
|
13
|
+
"rewards": { "claimed": 0, "total": 1, "items": [{ "name": "Pear Badge", "required": 30 }] }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -14,7 +14,21 @@
|
|
|
14
14
|
"image": "https://files.kick.com/images/subcategories/1/banner/neon-rush.webp",
|
|
15
15
|
"endsAt": "2026-10-21T18:00:00Z",
|
|
16
16
|
"doneAt": "2026-10-18T10:24:00Z",
|
|
17
|
-
"rewards": {
|
|
17
|
+
"rewards": {
|
|
18
|
+
"claimed": 1,
|
|
19
|
+
"total": 3,
|
|
20
|
+
"items": [
|
|
21
|
+
{ "name": "Pear Badge", "image": "https://files.kick.com/drops/reward/pear-badge.png", "required": 30, "state": "claimed" },
|
|
22
|
+
{
|
|
23
|
+
"name": "Hype Rocket Emote",
|
|
24
|
+
"image": "https://files.kick.com/drops/reward/hype-rocket.png",
|
|
25
|
+
"required": 60,
|
|
26
|
+
"state": "locked",
|
|
27
|
+
"unlocksAt": "2026-10-18T09:24:00Z"
|
|
28
|
+
},
|
|
29
|
+
{ "name": "Neon Crown", "required": 120, "state": "locked", "unlocksAt": "2026-10-18T10:24:00Z" }
|
|
30
|
+
]
|
|
31
|
+
},
|
|
18
32
|
"next": {
|
|
19
33
|
"name": "Hype Rocket Emote",
|
|
20
34
|
"image": "https://files.kick.com/drops/reward/hype-rocket.png",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamorchard/grapevine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Lets desktop apps on the same computer find each other and talk, privately: local sockets, JSON-RPC, pairing and versioned capabilities.",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"author": "StreamOrchard",
|
|
@@ -121,6 +121,14 @@
|
|
|
121
121
|
"total": {
|
|
122
122
|
"type": "integer",
|
|
123
123
|
"minimum": 0
|
|
124
|
+
},
|
|
125
|
+
"items": {
|
|
126
|
+
"type": "array",
|
|
127
|
+
"maxItems": 20,
|
|
128
|
+
"items": {
|
|
129
|
+
"$ref": "#Reward"
|
|
130
|
+
},
|
|
131
|
+
"description": "Every reward of the drop, in the order they unlock"
|
|
124
132
|
}
|
|
125
133
|
}
|
|
126
134
|
},
|
|
@@ -190,6 +198,42 @@
|
|
|
190
198
|
"description": "The stream being watched, while farming: its title and viewers"
|
|
191
199
|
}
|
|
192
200
|
}
|
|
201
|
+
},
|
|
202
|
+
"Reward": {
|
|
203
|
+
"type": "object",
|
|
204
|
+
"required": ["name", "required", "state"],
|
|
205
|
+
"properties": {
|
|
206
|
+
"name": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"maxLength": 200
|
|
209
|
+
},
|
|
210
|
+
"image": {
|
|
211
|
+
"$ref": "common:Image"
|
|
212
|
+
},
|
|
213
|
+
"required": {
|
|
214
|
+
"type": "number",
|
|
215
|
+
"minimum": 0,
|
|
216
|
+
"description": "Minutes of watching it unlocks at"
|
|
217
|
+
},
|
|
218
|
+
"state": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"minLength": 1,
|
|
221
|
+
"maxLength": 32,
|
|
222
|
+
"x-open": ["claimed", "ready", "locked"],
|
|
223
|
+
"description": "ready: unlocked, waiting to be claimed"
|
|
224
|
+
},
|
|
225
|
+
"unlocksAt": {
|
|
226
|
+
"anyOf": [
|
|
227
|
+
{
|
|
228
|
+
"$ref": "common:Timestamp"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"type": "null"
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
"description": "For a locked one: when it should unlock, at the current rate"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
193
237
|
}
|
|
194
238
|
}
|
|
195
239
|
}
|
package/types/capabilities.d.ts
CHANGED
|
@@ -56,6 +56,8 @@ export type DropsFarmingV1State = {
|
|
|
56
56
|
rewards?: {
|
|
57
57
|
claimed: number;
|
|
58
58
|
total: number;
|
|
59
|
+
/** Every reward of the drop, in the order they unlock */
|
|
60
|
+
items?: Array<DropsFarmingV1Reward>;
|
|
59
61
|
};
|
|
60
62
|
/** The reward being worked towards */
|
|
61
63
|
next?: {
|
|
@@ -74,6 +76,17 @@ export type DropsFarmingV1State = {
|
|
|
74
76
|
} | null;
|
|
75
77
|
};
|
|
76
78
|
|
|
79
|
+
export type DropsFarmingV1Reward = {
|
|
80
|
+
name: string;
|
|
81
|
+
image?: Image;
|
|
82
|
+
/** Minutes of watching it unlocks at */
|
|
83
|
+
required: number;
|
|
84
|
+
/** ready: unlocked, waiting to be claimed */
|
|
85
|
+
state: "claimed" | "ready" | "locked" | (string & {});
|
|
86
|
+
/** For a locked one: when it should unlock, at the current rate */
|
|
87
|
+
unlocksAt?: Timestamp | null;
|
|
88
|
+
};
|
|
89
|
+
|
|
77
90
|
// players 1.0: An app's stream players, by site: whether they're signed in, and which channels are open. Provided by Stream Multiview.
|
|
78
91
|
export type PlayersV1State = {
|
|
79
92
|
seq: number;
|