eleven / messenger Public

Clone
git clone https://amadan.net/eleven/messenger

Plain git — no account needed to clone.

Download

Download this file

1{
2 "schema": 1,
3 "flow": "welcome",
4 "entry": "hello",
5 "resumedIf": {
6 "any": [
7 "done.access",
8 "done.name",
9 "bridge.myName"
10 ]
11 },
12 "resumeUnless": {
13 "all": [
14 "bridge.enrolled",
15 "!done.access"
16 ]
17 },
18 "resumeSay": "Welcome back β€” let's pick up where we left off.",
19 "steps": [
20 {
21 "id": "hello",
22 "skipIf": [
23 "resumed"
24 ],
25 "bubbles": [
26 {
27 "text": [
28 "Welcome! πŸ‘‹ I'm Eleven, your guide here.\n\n",
29 {
30 "if": "inviterName",
31 "text": "{inviterName} invited you to {space.name|this space}"
32 },
33 {
34 "if": "!inviterName",
35 "text": "You've been invited to {space.name|this space}"
36 },
37 " β€” a private, invite-only chat space. It isn't a big platform with accounts and feeds: it's a small server ",
38 {
39 "if": "adminName",
40 "text": "run by {adminName}"
41 },
42 {
43 "if": "!adminName",
44 "text": "run by one of its members"
45 },
46 ", just for the people in it.\n\n",
47 "Everything here β€” messages, photos, even names β€” is locked with keys only members hold, so nobody outside a chat can ever read it. Not the server, and not whoever runs it."
48 ]
49 }
50 ],
51 "auto": "access"
52 },
53 {
54 "id": "access",
55 "entries": [
56 {
57 "if": "native",
58 "recordIfNew": {
59 "label": "Your access is already secured by your Eleven sign-in",
60 "value": "native"
61 },
62 "goto": "name"
63 },
64 {
65 "if": {
66 "any": [
67 "bridge.enrolled",
68 "done"
69 ]
70 },
71 "recordIfNew": {
72 "label": "Signed in β€” your access is safe",
73 "value": "passkey"
74 },
75 "sayIfNew": "Great β€” you're signed in, so your access is safe. πŸ”’ Let's continue.",
76 "goto": "name"
77 },
78 {
79 "if": "!bridge.canEnrol",
80 "recordIfNew": {
81 "label": "Your access lives in this browser",
82 "value": "local"
83 },
84 "goto": "name"
85 }
86 ],
87 "settle": {
88 "when": "bridge.enrolled"
89 },
90 "bubbles": [
91 {
92 "text": "Before anything else, let's make sure you can't lose your way in. πŸ”‘\n\nYour access to this space lives in a key that exists only in this browser β€” there's no username or password, and nobody can reset it for you. If this browser's data is cleared, your access goes with it.\n\nSign in with Eleven and your access is safe β€” one tap, your face or fingerprint, and you'll be brought straight back so we can carry on."
93 }
94 ],
95 "chips": [
96 {
97 "label": "Sign in (recommended)",
98 "advancing": false,
99 "effect": {
100 "verb": "savePasskey"
101 },
102 "probe": {
103 "afterMs": 1500,
104 "unless": "bridge.enrolled",
105 "goto": "access-waiting"
106 }
107 },
108 {
109 "label": "Not now",
110 "spent": "Skipped",
111 "effect": {
112 "verb": "deferBackupReminders"
113 },
114 "record": {
115 "label": "Skipped signing in for now",
116 "value": "skipped"
117 },
118 "ack": "No problem β€” I'll nudge you again in a day or so.",
119 "goto": "name"
120 },
121 {
122 "label": "Fill in a form instead",
123 "trailing": true,
124 "advancing": false,
125 "effect": {
126 "verb": "openQuickForm"
127 }
128 }
129 ]
130 },
131 {
132 "id": "access-waiting",
133 "settle": {
134 "when": "bridge.enrolled",
135 "goto": "access"
136 },
137 "bubbles": [
138 {
139 "text": "I'll wait here while you finish signing in. When you're done, tap Continue."
140 }
141 ],
142 "chips": [
143 {
144 "label": "Continue",
145 "record": {
146 "step": "access",
147 "label": {
148 "if": "bridge.enrolled",
149 "then": "Signed in β€” your access is safe",
150 "else": "Signed in (in this browser)"
151 },
152 "value": "passkey"
153 },
154 "ack": "Perfect β€” you're all set. πŸ”’",
155 "goto": "name"
156 },
157 {
158 "label": "It didn't work β€” skip for now",
159 "spent": "Skipped",
160 "effect": {
161 "verb": "deferBackupReminders"
162 },
163 "record": {
164 "step": "access",
165 "label": "Skipped signing in for now",
166 "value": "skipped"
167 },
168 "ack": "No problem β€” I'll nudge you again in a day or so.",
169 "goto": "name"
170 }
171 ]
172 },
173 {
174 "id": "name",
175 "skipIf": [
176 "done",
177 "bridge.myName"
178 ],
179 "bubbles": [
180 {
181 "text": "{ack?}First things first β€” what should folks here call you? Reply with your name.",
182 "key": "q-name",
183 "label": "Your name:",
184 "hint": "e.g. Finn Wolfhard"
185 }
186 ],
187 "chips": [
188 {
189 "if": "suggested",
190 "label": "I'm {suggested}",
191 "set": {
192 "vars.answer": "{suggested}"
193 },
194 "effect": {
195 "verb": "setMyName",
196 "args": [
197 "$answer"
198 ]
199 },
200 "record": {
201 "label": "noted: you're {vars.answer}",
202 "value": "$answer"
203 },
204 "ack": "Lovely to meet you, {vars.answer}! 🀝",
205 "goto": "photo"
206 }
207 ],
208 "input": {
209 "kind": "text",
210 "required": true,
211 "maxLen": 32,
212 "clean": "name"
213 },
214 "effect": {
215 "verb": "setMyName",
216 "args": [
217 "$answer"
218 ]
219 },
220 "on": {
221 "ok": {
222 "record": {
223 "label": "noted: you're {vars.answer}",
224 "value": "$answer"
225 },
226 "ack": "Lovely to meet you, {vars.answer}! 🀝",
227 "goto": "photo"
228 }
229 }
230 },
231 {
232 "id": "photo",
233 "skipIf": [
234 "done",
235 "native"
236 ],
237 "skipTo": "finish",
238 "bubbles": [
239 {
240 "text": "{ack?}Want to add a profile photo? Only members of this space can see it β€” like everything else here, it's encrypted.",
241 "key": "q-photo"
242 },
243 {
244 "text": "Send me a photo β€” tap the + next to the message box, or just drag a picture into the chat, and hit send. If you type a message with it, I'll keep that as the photo's description. Or skip for now.",
245 "attachHint": "Optional: describe your photo"
246 }
247 ],
248 "chips": [
249 {
250 "label": "Skip for now",
251 "spent": "Skipped",
252 "cancelInput": true,
253 "set": {
254 "vars.skippedPhoto": true
255 },
256 "record": {
257 "label": "skipped the profile photo",
258 "value": "skipped"
259 },
260 "goto": "finish"
261 }
262 ],
263 "input": {
264 "kind": "photo",
265 "reject": {
266 "text": "Send it as a picture β€” tap the + next to the message box or drag one in β€” or tap Skip.",
267 "local": true
268 }
269 },
270 "effect": {
271 "verb": "adoptProfilePhoto"
272 },
273 "on": {
274 "ok": {
275 "goto": "photo-preview"
276 },
277 "nokey": {
278 "say": "One sec β€” I'm still finishing your secure setup. Try sending it again in a moment, or skip for now.",
279 "local": true,
280 "ask": "Ready when you are β€” send that photo again, or skip it."
281 },
282 "error": {
283 "say": "Hmm, I couldn't use that one β€” try another?",
284 "local": true,
285 "ask": "Of course! Send me another one whenever you're ready β€” and pop a message with it if you'd like a description. πŸ“·"
286 }
287 }
288 },
289 {
290 "id": "photo-preview",
291 "bubbles": [
292 {
293 "text": "Here's how it looks. Happy with it, or want to try another?",
294 "img": "$myAvatar",
295 "imgAlt": "Your profile photo",
296 "imgRound": true,
297 "local": true
298 }
299 ],
300 "chips": [
301 {
302 "label": "Keep this photo",
303 "spent": "Kept",
304 "record": {
305 "step": "photo",
306 "label": "set your profile photo"
307 },
308 "goto": "finish"
309 },
310 {
311 "label": "Use a different photo",
312 "gotoAsk": {
313 "step": "photo",
314 "text": "Of course! Send me another one whenever you're ready β€” and pop a message with it if you'd like a description. πŸ“·"
315 }
316 }
317 ]
318 },
319 {
320 "id": "finish",
321 "record": {
322 "label": "You're all set",
323 "value": "done"
324 },
325 "effects": [
326 {
327 "verb": "markWelcomeDone"
328 }
329 ],
330 "bubbles": [
331 {
332 "text": [
333 {
334 "if": "vars.skippedPhoto",
335 "text": "No problem β€” you can add one anytime from your profile.\n\n"
336 },
337 "That's it β€” you're all set. πŸŽ‰ Enjoy {space.name|this space}!",
338 {
339 "if": "openGroups",
340 "text": "\n\nThis space also has open groups anyone here can join β€” have a look around whenever you like."
341 },
342 {
343 "if": {
344 "all": [
345 "!accessBackedUp",
346 "bridge.canEnrol"
347 ]
348 },
349 "text": "\n\nOne more reminder before you go: you haven't signed in yet, so your access to this space lives only in this browser β€” if it's cleared or lost, there's no way back in. Sign in any time and you're safe."
350 }
351 ],
352 "key": "q-finish"
353 },
354 {
355 "text": "Where would you like to start?"
356 }
357 ],
358 "chips": [
359 {
360 "if": {
361 "all": [
362 "!accessBackedUp",
363 "bridge.canEnrol"
364 ]
365 },
366 "label": "Sign in",
367 "advancing": false,
368 "effect": {
369 "verb": "savePasskey"
370 }
371 },
372 {
373 "if": {
374 "all": [
375 "hasPendingThread",
376 "inviterName"
377 ]
378 },
379 "label": "Say hi to {inviterName}",
380 "advancing": false,
381 "effect": {
382 "verb": "openPendingThread"
383 }
384 },
385 {
386 "if": {
387 "all": [
388 "hasPendingThread",
389 "!inviterName"
390 ]
391 },
392 "label": "Open your first chat",
393 "advancing": false,
394 "effect": {
395 "verb": "openPendingThread"
396 }
397 },
398 {
399 "if": "openGroups",
400 "label": "Browse open groups",
401 "advancing": false,
402 "effect": {
403 "verb": "openDiscover"
404 }
405 },
406 {
407 "if": "!native",
408 "label": "Take the tour",
409 "advancing": false,
410 "effect": {
411 "verb": "startTour"
412 }
413 }
414 ],
415 "end": true
416 }
417 ]
418}
419