@hanzo/app 0.2.58 → 0.3.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/README.md +8 -8
- package/dist/{Me.d.ts → Account.d.ts} +1 -1
- package/dist/{Me.js → Account.js} +3 -3
- package/dist/App.d.ts +2 -2
- package/dist/App.js +16 -16
- package/dist/{Top.d.ts → Bar.d.ts} +1 -1
- package/dist/{Top.js → Bar.js} +3 -3
- package/dist/Betas.js +1 -1
- package/dist/Board.js +4 -4
- package/dist/Chat.d.ts +4 -4
- package/dist/Chat.js +96 -96
- package/dist/Contacts.js +17 -15
- package/dist/Directory.js +7 -21
- package/dist/Drive.js +6 -6
- package/dist/{Orgs.d.ts → Gate.d.ts} +1 -1
- package/dist/{Orgs.js → Gate.js} +32 -32
- package/dist/{Chrome.d.ts → Header.d.ts} +1 -1
- package/dist/{Chrome.js → Header.js} +1 -1
- package/dist/Home.d.ts +3 -3
- package/dist/Home.js +30 -30
- package/dist/Inbox.js +29 -33
- package/dist/Meet.js +22 -22
- package/dist/Rail.js +6 -6
- package/dist/RightPane.js +2 -2
- package/dist/{Palette.d.ts → Search.d.ts} +1 -1
- package/dist/{Palette.js → Search.js} +1 -1
- package/dist/Settings.d.ts +3 -3
- package/dist/Settings.js +5 -5
- package/dist/SettingsPane.d.ts +2 -2
- package/dist/SettingsPane.js +5 -5
- package/dist/Setup.js +2 -2
- package/dist/Shell.d.ts +22 -31
- package/dist/Shell.js +167 -114
- package/dist/{Column.d.ts → Sidebar.d.ts} +1 -1
- package/dist/{Column.js → Sidebar.js} +5 -5
- package/dist/Support.js +2 -2
- package/dist/Talk.d.ts +3 -3
- package/dist/Talk.js +18 -18
- package/dist/TeamPreview.js +26 -26
- package/dist/TeamStory.js +1 -1
- package/dist/Usage.js +2 -2
- package/dist/Work.js +2 -2
- package/dist/bots/Bots.js +2 -2
- package/dist/bots/Lights.d.ts +1 -1
- package/dist/bots/Lights.js +1 -1
- package/dist/bots/api.d.ts +8 -7
- package/dist/bots/api.js +4 -4
- package/dist/bots/ink.js +3 -3
- package/dist/bots/kit.d.ts +2 -2
- package/dist/bots/kit.js +4 -4
- package/dist/bots/runtime.js +12 -12
- package/dist/cast.d.ts +14 -14
- package/dist/cast.js +12 -12
- package/dist/channels.d.ts +132 -0
- package/dist/{rooms.js → channels.js} +56 -55
- package/dist/conversations.d.ts +8 -8
- package/dist/conversations.js +18 -17
- package/dist/crew.d.ts +1 -1
- package/dist/crew.js +12 -12
- package/dist/dev.js +6 -6
- package/dist/failure.d.ts +2 -2
- package/dist/failure.js +6 -6
- package/dist/ground.d.ts +1 -1
- package/dist/ground.js +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.js +2 -2
- package/dist/hint.d.ts +1 -1
- package/dist/hint.js +1 -1
- package/dist/host.d.ts +15 -15
- package/dist/host.js +13 -13
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/lib/ai.js +1 -1
- package/dist/lib/api.d.ts +1 -1
- package/dist/lib/api.js +1 -1
- package/dist/lib/destination.d.ts +3 -3
- package/dist/lib/destination.js +3 -3
- package/dist/lib/home.d.ts +2 -2
- package/dist/lib/home.js +2 -2
- package/dist/lib/host.d.ts +17 -16
- package/dist/lib/host.js +19 -18
- package/dist/lib/hostname.d.ts +1 -1
- package/dist/lib/hostname.js +1 -1
- package/dist/lib/list.d.ts +1 -1
- package/dist/lib/list.js +1 -1
- package/dist/lib/models.js +1 -1
- package/dist/lib/org.d.ts +1 -1
- package/dist/lib/org.js +1 -1
- package/dist/lib/orgname.d.ts +1 -1
- package/dist/lib/orgname.js +1 -1
- package/dist/lib/session.d.ts +4 -4
- package/dist/lib/session.js +6 -6
- package/dist/lib/tier.d.ts +4 -4
- package/dist/lib/tier.js +5 -5
- package/dist/lib/tiers.d.ts +1 -1
- package/dist/lib/tiers.js +10 -10
- package/dist/lib/web.d.ts +1 -1
- package/dist/lib/web.js +1 -1
- package/dist/look.js +7 -9
- package/dist/network.d.ts +18 -18
- package/dist/network.js +28 -28
- package/dist/open.d.ts +24 -22
- package/dist/open.js +19 -19
- package/dist/pane.d.ts +6 -6
- package/dist/pane.js +10 -10
- package/dist/roster.d.ts +2 -2
- package/dist/roster.js +1 -1
- package/dist/seek.js +1 -1
- package/dist/slide.d.ts +1 -1
- package/dist/slide.js +1 -1
- package/dist/span.js +1 -1
- package/dist/stars.d.ts +4 -4
- package/dist/stars.js +8 -10
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.js +1 -1
- package/dist/team.js +1 -1
- package/dist/thread.d.ts +3 -3
- package/dist/thread.js +4 -4
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/dist/where.d.ts +7 -7
- package/dist/where.js +2 -2
- package/dist/workday.d.ts +26 -26
- package/dist/workday.js +187 -187
- package/package.json +8 -8
- package/dist/Room.d.ts +0 -8
- package/dist/Room.js +0 -51
- package/dist/rooms.d.ts +0 -131
- /package/dist/lib/{rooms.json → routes.json} +0 -0
package/dist/workday.js
CHANGED
|
@@ -107,11 +107,11 @@ export const MISSIONS = {
|
|
|
107
107
|
friday: { title: phrase('A recipe app by Sunday'), steps: [phrase('Set up the board'), phrase('Search by ingredient'), phrase('Pick a logo'), phrase('Book game night')] },
|
|
108
108
|
lab: { title: phrase('A first prototype'), steps: [phrase('Boot it'), phrase('Plan a week with it'), phrase('Write up what broke')] },
|
|
109
109
|
};
|
|
110
|
-
export const orgOf = (
|
|
111
|
-
export const channelOf = (
|
|
110
|
+
export const orgOf = (channel) => ORGS.find((o) => o.id === channel.split('/')[0]) ?? ORGS[0];
|
|
111
|
+
export const channelOf = (channel) => channel.split('/')[1] ?? 'general';
|
|
112
112
|
/** Minutes after midnight. */
|
|
113
113
|
const hm = (h, m) => h * 60 + m;
|
|
114
|
-
/** What each
|
|
114
|
+
/** What each channel already holds when the day begins, so none opens empty. */
|
|
115
115
|
const SEED = {
|
|
116
116
|
'acme/general': [
|
|
117
117
|
{ who: 'zoe', text: phrase('Welcome to Acme. Agents are teammates here: mention one to hand it work.'), time: hm(8, 30) },
|
|
@@ -147,26 +147,26 @@ const SEED = {
|
|
|
147
147
|
'lab/general': [{ who: 'priya', text: phrase('The prototype boots. That is all it does.'), time: hm(21, 0) }],
|
|
148
148
|
'lab/ideas': [{ who: 'theo', text: phrase('A bot that waters the plants.'), time: hm(21, 5) }],
|
|
149
149
|
};
|
|
150
|
-
/**
|
|
150
|
+
/** Channels with news before the day starts: their name is bold, their org's tile marked. */
|
|
151
151
|
export const UNREAD = { 'acme/random': 2, 'orbit/releases': 3, 'friday/ideas': 1, 'lab/ideas': 1 };
|
|
152
|
-
/** The events of one
|
|
153
|
-
function
|
|
154
|
-
return [{ kind: 'open',
|
|
152
|
+
/** The events of one channel's scene, in the channel's own words. */
|
|
153
|
+
function scene(id, time, build) {
|
|
154
|
+
return [{ kind: 'open', channel: id, time }, ...build(new Script(id))];
|
|
155
155
|
}
|
|
156
|
-
/** Writes a
|
|
157
|
-
class
|
|
156
|
+
/** Writes a channel's events without naming the channel each time. */
|
|
157
|
+
class Script {
|
|
158
158
|
id;
|
|
159
159
|
constructor(id) {
|
|
160
160
|
this.id = id;
|
|
161
161
|
}
|
|
162
162
|
say(who, text, more = {}) {
|
|
163
|
-
return { kind: 'say',
|
|
163
|
+
return { kind: 'say', channel: this.id, who, text, ...more };
|
|
164
164
|
}
|
|
165
165
|
typing(who) {
|
|
166
|
-
return { kind: 'typing',
|
|
166
|
+
return { kind: 'typing', channel: this.id, who };
|
|
167
167
|
}
|
|
168
168
|
huddle(...who) {
|
|
169
|
-
return { kind: 'huddle',
|
|
169
|
+
return { kind: 'huddle', channel: this.id, who };
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
const react = (to, mark, n) => ({ kind: 'react', to, mark, n });
|
|
@@ -175,21 +175,21 @@ const card = (to, patch) => ({ kind: 'card', to, patch });
|
|
|
175
175
|
const thread = (to) => ({ kind: 'thread', to });
|
|
176
176
|
/** A step of an org's mission is done. */
|
|
177
177
|
const step = (org, n) => ({ kind: 'step', org, n });
|
|
178
|
-
/** A message that arrives in another
|
|
179
|
-
const elsewhere = (
|
|
178
|
+
/** A message that arrives in another channel while this one is open: it goes unread, and it is the next channel's first line. */
|
|
179
|
+
const elsewhere = (channel, who, text, more = {}) => ({ kind: 'say', channel, who, text, ...more });
|
|
180
180
|
/**
|
|
181
181
|
* The morning, across organizations: Acme's #general, a thank-you from the
|
|
182
182
|
* open-source project that took Acme's fix, friends planning tonight's build,
|
|
183
183
|
* and back to Acme, where #eng has news. Three switches in under thirty seconds.
|
|
184
184
|
*/
|
|
185
|
-
const MORNING =
|
|
186
|
-
|
|
185
|
+
const MORNING = scene('acme/general', hm(9, 2), (c) => [
|
|
186
|
+
c.say('zoe', phrase("Morning. Launch is Thursday, and Orbit's maintainers are helping us test it.")),
|
|
187
187
|
elsewhere('orbit/contributors', 'priya', phrase('@dev your retry fix from Acme landed upstream. Thank you.'), { id: 'upstream' }),
|
|
188
188
|
]);
|
|
189
189
|
/** Orbit: people from different teams, and an agent that works for more than one. */
|
|
190
|
-
const ORBIT =
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
const ORBIT = scene('orbit/contributors', hm(9, 4), (c) => [
|
|
191
|
+
c.typing('dev'),
|
|
192
|
+
c.say('dev', phrase('Glad it helped. I opened a follow-up so the docs say how retries back off.'), {
|
|
193
193
|
id: 'followup',
|
|
194
194
|
card: { kind: 'pr', repo: 'orbit/orbit', number: 1187, title: phrase('Docs: how retries back off'), add: 42, del: 6, state: 'review', reviewer: 'priya' },
|
|
195
195
|
}),
|
|
@@ -198,61 +198,61 @@ const ORBIT = room('orbit/contributors', hm(9, 4), (r) => [
|
|
|
198
198
|
elsewhere('friday/side-project', 'omar', phrase("Tonight's build still on?")),
|
|
199
199
|
]);
|
|
200
200
|
/** Friends, in the morning: tonight is on. */
|
|
201
|
-
const PLANS =
|
|
202
|
-
|
|
201
|
+
const PLANS = scene('friday/side-project', hm(9, 6), (c) => [
|
|
202
|
+
c.say('leo', phrase('On. @mu a playlist for it?')),
|
|
203
203
|
elsewhere('acme/eng', 'theo', phrase('Heads up: checkout looks odd on main.')),
|
|
204
204
|
]);
|
|
205
205
|
/** Coding together: a bug report, a pull request, a review, the checks, the merge. */
|
|
206
|
-
const ENG =
|
|
207
|
-
|
|
206
|
+
const ENG = scene('acme/eng', hm(9, 12), (c) => [
|
|
207
|
+
c.say('mina', phrase('Checkout charges twice if you press Pay twice. Steps are in the thread.'), { id: 'bug' }),
|
|
208
208
|
reply('bug', 'mina', phrase('Card form, press Pay, press Pay again before it answers. Two charges.')),
|
|
209
209
|
react('bug', 'eyes', 2),
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
210
|
+
c.say('sam', phrase('@dev can you take this one?')),
|
|
211
|
+
c.typing('dev'),
|
|
212
|
+
c.say('dev', phrase('On it. The Pay button stays live until the charge answers, so a second press is a second charge.')),
|
|
213
|
+
c.typing('dev'),
|
|
214
|
+
c.say('dev', phrase('Pull request is up. A new test presses Pay twice and expects one charge.'), {
|
|
215
215
|
id: 'pr',
|
|
216
216
|
card: { kind: 'pr', repo: 'acme/web', number: 482, title: phrase('Disable Pay while a charge is pending'), add: 18, del: 3, state: 'review', reviewer: 'theo' },
|
|
217
217
|
}),
|
|
218
218
|
thread('pr'),
|
|
219
219
|
reply('pr', 'theo', phrase('Reviewing. Could the button show a spinner too? A grey button looks broken.')),
|
|
220
|
-
|
|
220
|
+
c.typing('dev'),
|
|
221
221
|
reply('pr', 'dev', phrase('Added a spinner, and the button now says Paying.')),
|
|
222
222
|
card('pr', { state: 'passed' }),
|
|
223
223
|
reply('pr', 'theo', phrase('Approved.')),
|
|
224
224
|
thread(null),
|
|
225
225
|
elsewhere('friday/side-project', 'mu', phrase('Playlist is ready: forty minutes, no lyrics, nothing that sounds like a deadline.')),
|
|
226
226
|
react('pr', 'rocket', 3),
|
|
227
|
-
|
|
227
|
+
c.typing('dev'),
|
|
228
228
|
card('pr', { state: 'merged' }),
|
|
229
|
-
|
|
229
|
+
c.say('dev', phrase('Merged and deployed. Checkout is live with the fix.')),
|
|
230
230
|
step('acme', 0),
|
|
231
|
-
|
|
231
|
+
c.say('mina', phrase('Pressed Pay four times on purpose. Charged once.'), { id: 'tried' }),
|
|
232
232
|
react('tried', 'party', 3),
|
|
233
|
-
|
|
233
|
+
c.say('sam', phrase('Pressing Pay twice is no longer a personality trait we support.'), { id: 'trait' }),
|
|
234
234
|
react('trait', 'laugh', 4),
|
|
235
235
|
elsewhere('acme/support', 'su', phrase('New ticket: invoices download as blank PDFs in Safari.')),
|
|
236
236
|
]);
|
|
237
237
|
/** Support together: an agent drafts, a person makes it warmer, it is sent, the cause is fixed. */
|
|
238
|
-
const SUPPORT =
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
const SUPPORT = scene('acme/support', hm(10, 4), (c) => [
|
|
239
|
+
c.typing('su'),
|
|
240
|
+
c.say('su', phrase('Drafted a reply.'), {
|
|
241
241
|
id: 'answer',
|
|
242
242
|
card: { kind: 'draft', to: phrase('Ticket #1042'), body: phrase('Sorry about the blank invoices. Safari blocks the download; this link opens them now, and a fix ships today.'), approver: 'nia' },
|
|
243
243
|
}),
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
c.say('nia', phrase("Warmer first line, please. And let's not blame Safari in writing.")),
|
|
245
|
+
c.typing('su'),
|
|
246
246
|
card('answer', { body: phrase('Thanks for telling us, and sorry for the blank invoices. This link opens them now, and a fix ships today.') }),
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
c.say('su', phrase('Updated.')),
|
|
248
|
+
c.say('nia', phrase('Perfect. Send it.')),
|
|
249
249
|
card('answer', { sent: true }),
|
|
250
250
|
react('answer', 'check', 1),
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
c.say('su', phrase('Sent. @dev the download link expires before Safari opens it.')),
|
|
252
|
+
c.typing('dev'),
|
|
253
|
+
c.say('dev', phrase('Found it. Links last five minutes now instead of five seconds. The fix is in #483.'), { id: 'links' }),
|
|
254
254
|
react('links', 'laugh', 3),
|
|
255
|
-
|
|
255
|
+
c.say('su', phrase('The customer wrote back: “That was fast. Thank you.”'), { id: 'thanks' }),
|
|
256
256
|
react('thanks', 'heart', 5),
|
|
257
257
|
step('acme', 1),
|
|
258
258
|
elsewhere('acme/inbox', 'opera', phrase('Morning sort is done.'), {
|
|
@@ -265,41 +265,41 @@ const SUPPORT = room('acme/support', hm(10, 4), (r) => [
|
|
|
265
265
|
}),
|
|
266
266
|
]);
|
|
267
267
|
/** Email: the agent triages and drafts, a person approves a batch, a lawyer catches a clause. */
|
|
268
|
-
const INBOX =
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
const INBOX = scene('acme/inbox', hm(10, 41), (c) => [
|
|
269
|
+
c.say('opera', phrase('Six replies are drafted in your voice. Approve them as a batch?'), { id: 'batch', card: { kind: 'ask', options: [phrase('Approve all'), phrase('One by one')], asks: 'ada' } }),
|
|
270
|
+
c.typing('ada'),
|
|
271
271
|
card('batch', { picked: 0 }),
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
272
|
+
c.say('ada', phrase('Approve all. You know how I write by now.')),
|
|
273
|
+
c.typing('opera'),
|
|
274
|
+
c.say('opera', phrase("Sent all six. The renewal needs a lawyer's eye, so I asked @law.")),
|
|
275
|
+
c.typing('law'),
|
|
276
|
+
c.say('law', phrase('Read it. It renews itself for three years. I would ask for one.'), { id: 'clause' }),
|
|
277
277
|
react('clause', 'eyes', 2),
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
c.say('ada', phrase('Good catch. Ask for one, nicely.')),
|
|
279
|
+
c.typing('opera'),
|
|
280
|
+
c.say('opera', phrase('Drafted.'), { id: 'renewal', card: { kind: 'draft', to: phrase('The vendor, about our renewal'), body: phrase('Happy to renew. Could we make the term one year, with the option to extend?'), approver: 'ada' } }),
|
|
281
|
+
c.say('ada', phrase('Nicely done. Send.')),
|
|
282
282
|
card('renewal', { sent: true }),
|
|
283
283
|
step('acme', 2),
|
|
284
|
-
|
|
284
|
+
c.say('opera', phrase('Sent. The inbox is at zero, except for the newsletter you keep meaning to read.'), { id: 'zero' }),
|
|
285
285
|
react('zero', 'laugh', 2),
|
|
286
286
|
elsewhere('acme/fundraise', 'zoe', phrase('@fin we need a seed deck by Friday.')),
|
|
287
287
|
]);
|
|
288
288
|
/** Fundraising: the deck and the model, the intros, a meeting booked. */
|
|
289
|
-
const FUNDRAISE =
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
289
|
+
const FUNDRAISE = scene('acme/fundraise', hm(11, 20), (c) => [
|
|
290
|
+
c.typing('fin'),
|
|
291
|
+
c.say('fin', phrase('On it: a deck, and a model with three scenarios where every number links to its source.')),
|
|
292
|
+
c.say('zoe', phrase("No hockey sticks we can't explain.")),
|
|
293
|
+
c.typing('fin'),
|
|
294
|
+
c.say('fin', phrase('Deck v1 is in Drive.'), { id: 'deck', card: { kind: 'file', name: 'Acme seed deck.pdf', type: 'deck', detail: phrase('12 slides') } }),
|
|
295
|
+
c.say('fin', phrase('And the model.'), { id: 'model', card: { kind: 'file', name: 'Acme model.xlsx', type: 'sheet', detail: phrase('Three scenarios, sources linked') } }),
|
|
296
|
+
c.say('fin', phrase('@sal the deck is ready for the intros.')),
|
|
297
|
+
c.say('zoe', phrase('Slide 4 says “synergy”. Remove it with prejudice.')),
|
|
298
|
+
c.typing('fin'),
|
|
299
|
+
c.say('fin', phrase('Removed. Slide 4 now says what the product does.'), { id: 'synergy' }),
|
|
300
300
|
react('synergy', 'laugh', 4),
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
c.typing('sal'),
|
|
302
|
+
c.say('sal', phrase('I found four investors who back developer tools. The intros are drafted in your voice.'), {
|
|
303
303
|
id: 'intros',
|
|
304
304
|
card: {
|
|
305
305
|
kind: 'list',
|
|
@@ -307,29 +307,29 @@ const FUNDRAISE = room('acme/fundraise', hm(11, 20), (r) => [
|
|
|
307
307
|
items: [phrase('A seed fund that backs developer tools'), phrase('An angel who built a developer tools company'), phrase('A partner who wrote about agents last week'), phrase('A fund Theo knows from his last company')],
|
|
308
308
|
},
|
|
309
309
|
}),
|
|
310
|
-
|
|
310
|
+
c.say('zoe', phrase('Send all four.')),
|
|
311
311
|
card('intros', { done: [0, 1, 2, 3] }),
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
c.say('sal', phrase('Sent.')),
|
|
313
|
+
c.typing('sal'),
|
|
314
|
+
c.say('sal', phrase('One replied already. Thursday at 2 works for them.'), { id: 'meeting', card: { kind: 'meeting', title: phrase('Acme and a seed fund'), when: phrase('Thursday, 2:00 PM') } }),
|
|
315
315
|
react('meeting', 'flame', 5),
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
316
|
+
c.say('theo', phrase('Prep doc?')),
|
|
317
|
+
c.typing('fin'),
|
|
318
|
+
c.say('fin', phrase('In the deck folder: the questions they are likely to ask, with our answers.')),
|
|
319
319
|
step('acme', 3),
|
|
320
320
|
elsewhere('acme/design', 'sam', phrase('@des the plan cards feel crowded.')),
|
|
321
321
|
]);
|
|
322
322
|
/** A design review: two directions, a pick, a handoff. */
|
|
323
|
-
const DESIGN =
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
323
|
+
const DESIGN = scene('acme/design', hm(13, 15), (c) => [
|
|
324
|
+
c.typing('des'),
|
|
325
|
+
c.say('des', phrase('Two directions. A keeps every feature; B keeps the five people compare.'), { id: 'options', card: { kind: 'options', file: 'plan-cards.fig', options: ['A', 'B'] } }),
|
|
326
|
+
c.say('ada', phrase('B. Fewer words, same truth.')),
|
|
327
|
+
c.say('sam', phrase('B, and the prices on one baseline.')),
|
|
328
328
|
card('options', { picked: 1 }),
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
329
|
+
c.typing('des'),
|
|
330
|
+
c.say('des', phrase('B it is, prices aligned. @dev the handoff is in the file.')),
|
|
331
|
+
c.typing('dev'),
|
|
332
|
+
c.say('dev', phrase('Picked it up. It will be on the preview link in ten minutes.'), { id: 'handoff' }),
|
|
333
333
|
react('handoff', 'heart', 3),
|
|
334
334
|
step('acme', 4),
|
|
335
335
|
elsewhere('acme/hiring', 'huma', phrase('Designer role: the shortlist is ready, with a note on each.'), {
|
|
@@ -338,40 +338,40 @@ const DESIGN = room('acme/design', hm(13, 15), (r) => [
|
|
|
338
338
|
}),
|
|
339
339
|
]);
|
|
340
340
|
/** Hiring: a shortlist, interviews booked, an exercise that respects weekends. */
|
|
341
|
-
const HIRING =
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
341
|
+
const HIRING = scene('acme/hiring', hm(14, 2), (c) => [
|
|
342
|
+
c.say('mina', phrase("Let's talk to all three.")),
|
|
343
|
+
c.typing('huma'),
|
|
344
|
+
c.say('huma', phrase('Booked for Tuesday and Wednesday. Des wrote the exercise: two hours, not a weekend.')),
|
|
345
|
+
c.say('mina', phrase('Thank you for respecting weekends.'), { id: 'weekends' }),
|
|
346
346
|
react('weekends', 'heart', 4),
|
|
347
|
-
|
|
347
|
+
c.say('des', phrase('One screen, two hours, no trick questions.')),
|
|
348
348
|
step('acme', 5),
|
|
349
349
|
elsewhere('acme/launch', 'mark', phrase('The launch post is drafted.'), { id: 'post', card: { kind: 'file', name: 'launch-post.md', type: 'doc', detail: phrase('Draft') } }),
|
|
350
350
|
]);
|
|
351
351
|
/** The launch: the post cut, translated, the checklist closed, a huddle, live. */
|
|
352
|
-
const LAUNCH =
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
352
|
+
const LAUNCH = scene('acme/launch', hm(15, 30), (c) => [
|
|
353
|
+
c.say('zoe', phrase('Shorter, please. Nobody reads paragraph four.')),
|
|
354
|
+
c.typing('mark'),
|
|
355
|
+
c.say('mark', phrase('Cut to three paragraphs. Paragraph four is now a footnote nobody will read either.'), { id: 'cut' }),
|
|
356
356
|
react('cut', 'laugh', 5),
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
357
|
+
c.say('mark', phrase('@lang can you take it into Japanese and Spanish?')),
|
|
358
|
+
c.typing('lang'),
|
|
359
|
+
c.say('lang', phrase('Translated into Japanese and Spanish. The terms match the glossary.')),
|
|
360
|
+
c.say('mana', phrase('Everything is done but the docs pass. @doc it is yours.'), {
|
|
361
361
|
id: 'checklist',
|
|
362
362
|
card: { kind: 'list', title: phrase('Launch checklist'), items: [phrase('Launch post'), phrase('Translations'), phrase('Pricing page'), phrase('Docs pass'), phrase('Status page')], done: [0, 1, 2, 4] },
|
|
363
363
|
}),
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
c.typing('doc'),
|
|
365
|
+
c.say('doc', phrase('Docs pass is done. The quickstart links the new pages.')),
|
|
366
366
|
card('checklist', { done: [0, 1, 2, 3, 4] }),
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
367
|
+
c.huddle('zoe', 'ada', 'sam'),
|
|
368
|
+
c.say('ada', phrase('Ship it.')),
|
|
369
|
+
c.typing('mark'),
|
|
370
|
+
c.say('mark', phrase('Posted. It is live.'), { id: 'live' }),
|
|
371
371
|
react('live', 'rocket', 8),
|
|
372
372
|
react('live', 'party', 6),
|
|
373
373
|
step('acme', 6),
|
|
374
|
-
|
|
374
|
+
c.huddle(),
|
|
375
375
|
elsewhere('acme/general', 'vi', phrase("Today's notes are ready."), {
|
|
376
376
|
id: 'notes',
|
|
377
377
|
card: {
|
|
@@ -383,95 +383,95 @@ const LAUNCH = room('acme/launch', hm(15, 30), (r) => [
|
|
|
383
383
|
}),
|
|
384
384
|
]);
|
|
385
385
|
/** The day closes in #general. */
|
|
386
|
-
const GENERAL =
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
const GENERAL = scene('acme/general', hm(17, 50), (c) => [
|
|
387
|
+
c.say('zoe', phrase('And nobody worked the weekend.')),
|
|
388
|
+
c.say('vi', phrase("Tomorrow's plan is on the board. Good evening, everyone."), { id: 'evening' }),
|
|
389
389
|
react('notes', 'heart', 9),
|
|
390
390
|
react('evening', 'thumbs', 5),
|
|
391
391
|
]);
|
|
392
392
|
/** Friends after work: a recipe app, a board, pairing, a logo before a product. */
|
|
393
|
-
const SIDE =
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
393
|
+
const SIDE = scene('friday/side-project', hm(19, 10), (c) => [
|
|
394
|
+
c.say('mina', phrase('Recipe app tonight?')),
|
|
395
|
+
c.say('omar', phrase('In. @mana set up a board?')),
|
|
396
|
+
c.typing('mana'),
|
|
397
|
+
c.say('mana', phrase('Board is ready: a card each.'), {
|
|
398
398
|
id: 'board',
|
|
399
399
|
card: { kind: 'list', title: phrase('Board'), items: [phrase('Sign-in'), phrase('Save a recipe'), phrase("Search by what's in the fridge")] },
|
|
400
400
|
}),
|
|
401
401
|
step('friday', 0),
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
402
|
+
c.say('jun', phrase("I'll take search. @dev pair with me?")),
|
|
403
|
+
c.typing('dev'),
|
|
404
|
+
c.say('dev', phrase('Pairing. Search works on ingredients now: “leftover pizza” returns pizza.'), { id: 'pizza' }),
|
|
405
405
|
card('board', { done: [2] }),
|
|
406
406
|
step('friday', 1),
|
|
407
407
|
react('pizza', 'laugh', 4),
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
408
|
+
c.say('leo', phrase('Bringing snacks and opinions.')),
|
|
409
|
+
c.typing('art'),
|
|
410
|
+
c.say('art', phrase('Logo sketches, in case anyone wants a logo before a product.'), { id: 'logos', card: { kind: 'file', name: 'logo-sketches.png', type: 'image', detail: phrase('Three options') } }),
|
|
411
411
|
react('logos', 'heart', 5),
|
|
412
412
|
step('friday', 2),
|
|
413
413
|
elsewhere('friday/game-night', 'omar', phrase('Game night Thursday?')),
|
|
414
414
|
]);
|
|
415
415
|
/** Game night, booked by an agent that is now in charge of scheduling forever. */
|
|
416
|
-
const GAME =
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
416
|
+
const GAME = scene('friday/game-night', hm(19, 42), (c) => [
|
|
417
|
+
c.say('mina', phrase('Yes. @vi can you find a time that works for everyone?')),
|
|
418
|
+
c.typing('vi'),
|
|
419
|
+
c.say('vi', phrase('Thursday at 8 works for all four of you. It is on your calendars.'), { id: 'slot', card: { kind: 'meeting', title: phrase('Game night'), when: phrase('Thursday, 8:00 PM') } }),
|
|
420
|
+
c.say('jun', phrase('Vi is now in charge of all scheduling, forever.'), { id: 'forever' }),
|
|
421
|
+
c.typing('vi'),
|
|
422
|
+
c.say('vi', phrase('Accepted. I will be fair.')),
|
|
423
423
|
react('forever', 'laugh', 3),
|
|
424
424
|
step('friday', 3),
|
|
425
425
|
]);
|
|
426
|
-
/**
|
|
426
|
+
/** Channels the day does not pass through, played when a reader opens them. */
|
|
427
427
|
const EXTRA = {
|
|
428
|
-
'acme/random':
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
428
|
+
'acme/random': scene('acme/random', hm(12, 30), (c) => [
|
|
429
|
+
c.say('theo', phrase('Lunch?')),
|
|
430
|
+
c.say('vi', phrase('The noodle place is quiet until 12:45. I booked a table for five.')),
|
|
431
|
+
c.say('theo', phrase('I said lunch, not a plan.'), { id: 'lunch' }),
|
|
432
432
|
react('lunch', 'laugh', 3),
|
|
433
433
|
]),
|
|
434
|
-
'friday/ideas':
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
434
|
+
'friday/ideas': scene('friday/ideas', hm(20, 5), (c) => [
|
|
435
|
+
c.say('leo', phrase('@mu a song for when the timer rings?')),
|
|
436
|
+
c.typing('mu'),
|
|
437
|
+
c.say('mu', phrase('Eight seconds, upbeat, and it stops when you open the oven.'), { id: 'song', card: { kind: 'file', name: 'timer.mp3', type: 'doc', detail: phrase('0:08') } }),
|
|
438
438
|
react('song', 'heart', 3),
|
|
439
439
|
]),
|
|
440
|
-
'orbit/general':
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
440
|
+
'orbit/general': scene('orbit/general', hm(9, 40), (c) => [
|
|
441
|
+
c.say('jun', phrase('First-time contributor here. Where do I start?')),
|
|
442
|
+
c.typing('doc'),
|
|
443
|
+
c.say('doc', phrase('The contributing guide, then any issue marked good first. I linked three that fit a first afternoon.')),
|
|
444
|
+
c.say('priya', phrase('Welcome aboard.'), { id: 'aboard' }),
|
|
445
445
|
react('aboard', 'party', 3),
|
|
446
446
|
]),
|
|
447
|
-
'orbit/releases':
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
447
|
+
'orbit/releases': scene('orbit/releases', hm(10, 15), (c) => [
|
|
448
|
+
c.say('theo', phrase('Is 2.4 ready to tag?')),
|
|
449
|
+
c.typing('cyber'),
|
|
450
|
+
c.say('cyber', phrase('The dependency audit is clean. Nothing new needs a patch.')),
|
|
451
|
+
c.say('doc', phrase('Changelog is final.'), { id: 'tag', card: { kind: 'file', name: 'CHANGELOG.md', type: 'doc', detail: phrase('2.4') } }),
|
|
452
452
|
react('tag', 'rocket', 5),
|
|
453
453
|
]),
|
|
454
|
-
'lab/general':
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
454
|
+
'lab/general': scene('lab/general', hm(21, 10), (c) => [
|
|
455
|
+
c.say('theo', phrase('What if the app planned the week for you?')),
|
|
456
|
+
c.typing('sci'),
|
|
457
|
+
c.say('sci', phrase('I will try it on our own calendars first and write up what happens.')),
|
|
458
|
+
c.say('priya', phrase('@data how often does a plan survive Tuesday?')),
|
|
459
|
+
c.typing('data'),
|
|
460
|
+
c.say('data', phrase('I can count that once we have a few weeks of plans to look at.'), { id: 'tuesday' }),
|
|
461
461
|
react('tuesday', 'eyes', 2),
|
|
462
462
|
]),
|
|
463
|
-
'lab/ideas':
|
|
463
|
+
'lab/ideas': scene('lab/ideas', hm(21, 20), (c) => [c.say('priya', phrase('A plant that texts when it is thirsty.')), c.say('theo', phrase('Filed under someday, next to the bot that waters it.'))]),
|
|
464
464
|
};
|
|
465
465
|
/** The day, in order. */
|
|
466
466
|
const SCENES = [MORNING, ORBIT, PLANS, ENG, SUPPORT, INBOX, FUNDRAISE, DESIGN, HIRING, LAUNCH, GENERAL, SIDE, GAME];
|
|
467
|
-
/** What a reader opening a
|
|
467
|
+
/** What a reader opening a channel plays: each channel's own scene (the morning's two passes are the day's, not a channel's). */
|
|
468
468
|
const OWN = [ORBIT, ENG, SUPPORT, INBOX, FUNDRAISE, DESIGN, HIRING, LAUNCH, GENERAL, SIDE, GAME];
|
|
469
469
|
/** Words a line holds: how long it takes to read. */
|
|
470
470
|
const words = (text) => text.split(/\s+/).filter(Boolean).length;
|
|
471
471
|
/**
|
|
472
472
|
* How long each event waits from the one before it: long enough to read what
|
|
473
473
|
* came before (a message, and a card under it), to watch someone type, to
|
|
474
|
-
* take in a
|
|
474
|
+
* take in a channel just opened.
|
|
475
475
|
*/
|
|
476
476
|
export function pace(events) {
|
|
477
477
|
return events.map((e, i) => {
|
|
@@ -504,9 +504,9 @@ export function pace(events) {
|
|
|
504
504
|
}
|
|
505
505
|
/** The whole day, paced. */
|
|
506
506
|
export const DAY = pace(SCENES.flat());
|
|
507
|
-
/** Every
|
|
508
|
-
export const SCENE = Object.fromEntries([...OWN, ...Object.values(EXTRA)].map((s) => [s[0].
|
|
509
|
-
/** The
|
|
507
|
+
/** Every channel's own scene, paced, for a reader who opens it. */
|
|
508
|
+
export const SCENE = Object.fromEntries([...OWN, ...Object.values(EXTRA)].map((s) => [s[0].channel, pace(s)]));
|
|
509
|
+
/** The channel an org opens on when its tile is pressed. */
|
|
510
510
|
export const HOME = { acme: 'acme/eng', orbit: 'orbit/contributors', friday: 'friday/side-project', lab: 'lab/general' };
|
|
511
511
|
/**
|
|
512
512
|
* The frame a reader who asked for less motion sees, and the first paint: the
|
|
@@ -518,23 +518,23 @@ export const STILL = MORNING.length + ORBIT.length + PLANS.length + ENG.length;
|
|
|
518
518
|
export const LENGTH = DAY.reduce((n, b) => n + b.wait, 0);
|
|
519
519
|
/** The handoffs a frame keeps: the newest. */
|
|
520
520
|
const HANDOFFS = 8;
|
|
521
|
-
/** How many messages a
|
|
521
|
+
/** How many messages a channel keeps on screen: the oldest leave the top. */
|
|
522
522
|
const KEEP = 14;
|
|
523
523
|
/** Folds the first `at` events into a frame. */
|
|
524
524
|
export function frame(events, at) {
|
|
525
|
-
const
|
|
525
|
+
const channels = {};
|
|
526
526
|
const where = new Map();
|
|
527
527
|
const seat = (id) => {
|
|
528
|
-
if (!
|
|
529
|
-
|
|
528
|
+
if (!channels[id]) {
|
|
529
|
+
channels[id] = (SEED[id] ?? []).map((s, i) => ({ id: `${id}#${i}`, who: s.who, text: s.text, time: s.time, reactions: [], replies: [] }));
|
|
530
530
|
}
|
|
531
|
-
return
|
|
531
|
+
return channels[id];
|
|
532
532
|
};
|
|
533
533
|
const unread = { ...UNREAD };
|
|
534
534
|
const huddle = {};
|
|
535
535
|
const steps = {};
|
|
536
536
|
const handoffs = [];
|
|
537
|
-
let view = events.find((e) => e.kind === 'open')?.
|
|
537
|
+
let view = events.find((e) => e.kind === 'open')?.channel ?? 'acme/eng';
|
|
538
538
|
let clock = hm(9, 0);
|
|
539
539
|
let thread = null;
|
|
540
540
|
let typing = null;
|
|
@@ -543,26 +543,26 @@ export function frame(events, at) {
|
|
|
543
543
|
typing = null;
|
|
544
544
|
switch (e.kind) {
|
|
545
545
|
case 'open':
|
|
546
|
-
view = e.
|
|
546
|
+
view = e.channel;
|
|
547
547
|
clock = Math.max(clock, e.time);
|
|
548
|
-
unread[e.
|
|
548
|
+
unread[e.channel] = 0;
|
|
549
549
|
thread = null;
|
|
550
|
-
seat(e.
|
|
550
|
+
seat(e.channel);
|
|
551
551
|
break;
|
|
552
552
|
case 'say': {
|
|
553
553
|
clock += Math.max(1, Math.round(words(e.text) / 10));
|
|
554
|
-
const m = { id: e.id ?? `${e.
|
|
555
|
-
seat(e.
|
|
554
|
+
const m = { id: e.id ?? `${e.channel}@${i}`, who: e.who, text: e.text, time: clock, card: e.card, reactions: [], replies: [] };
|
|
555
|
+
seat(e.channel).push(m);
|
|
556
556
|
where.set(m.id, m);
|
|
557
557
|
for (const [, to] of e.text.matchAll(/@([a-z]+)/g))
|
|
558
558
|
if (to !== e.who && (to in AGENTS || to in PEOPLE))
|
|
559
|
-
handoffs.push({ from: e.who, to,
|
|
560
|
-
if (e.
|
|
561
|
-
unread[e.
|
|
559
|
+
handoffs.push({ from: e.who, to, channel: e.channel, time: clock, text: e.text });
|
|
560
|
+
if (e.channel !== view)
|
|
561
|
+
unread[e.channel] = (unread[e.channel] ?? 0) + 1;
|
|
562
562
|
break;
|
|
563
563
|
}
|
|
564
564
|
case 'typing':
|
|
565
|
-
typing = {
|
|
565
|
+
typing = { channel: e.channel, who: e.who };
|
|
566
566
|
break;
|
|
567
567
|
case 'react': {
|
|
568
568
|
const m = where.get(e.to);
|
|
@@ -593,7 +593,7 @@ export function frame(events, at) {
|
|
|
593
593
|
thread = e.to;
|
|
594
594
|
break;
|
|
595
595
|
case 'huddle':
|
|
596
|
-
huddle[e.
|
|
596
|
+
huddle[e.channel] = e.who;
|
|
597
597
|
break;
|
|
598
598
|
case 'step':
|
|
599
599
|
steps[e.org] = [...new Set([...(steps[e.org] ?? []), e.n])];
|
|
@@ -601,30 +601,30 @@ export function frame(events, at) {
|
|
|
601
601
|
}
|
|
602
602
|
});
|
|
603
603
|
seat(view);
|
|
604
|
-
for (const id of Object.keys(
|
|
605
|
-
|
|
606
|
-
return {
|
|
604
|
+
for (const id of Object.keys(channels))
|
|
605
|
+
channels[id] = channels[id].slice(-KEEP);
|
|
606
|
+
return { channel: view, channels, unread, typing, thread, huddle, steps, handoffs: handoffs.slice(-HANDOFFS) };
|
|
607
607
|
}
|
|
608
608
|
/**
|
|
609
609
|
* What waits on a person in a frame. Always: a draft not yet sent, a question
|
|
610
610
|
* not yet answered, a pull request still under review. Supervised, also every
|
|
611
|
-
* agent's work a person has not answered yet in its
|
|
612
|
-
* each tool, connector or site (the app's Manual approval).
|
|
611
|
+
* agent's work a person has not answered yet in its channel: an agent asks
|
|
612
|
+
* before each tool, connector or site (the app's Manual approval).
|
|
613
613
|
*/
|
|
614
614
|
export function waiting(f, supervised) {
|
|
615
615
|
const out = [];
|
|
616
|
-
for (const [
|
|
616
|
+
for (const [channel, list] of Object.entries(f.channels)) {
|
|
617
617
|
list.forEach((m, i) => {
|
|
618
618
|
const c = m.card;
|
|
619
619
|
if (c?.kind === 'draft' && !c.sent)
|
|
620
|
-
out.push({ id: m.id,
|
|
620
|
+
out.push({ id: m.id, channel, who: c.approver ?? 'ada', say: phrase('Send the reply to {what}'), what: c.to });
|
|
621
621
|
else if (c?.kind === 'ask' && c.picked === undefined)
|
|
622
|
-
out.push({ id: m.id,
|
|
622
|
+
out.push({ id: m.id, channel, who: c.asks ?? 'ada', say: phrase('Answer: {what}'), what: m.text });
|
|
623
623
|
else if (c?.kind === 'pr' && c.state === 'review')
|
|
624
|
-
out.push({ id: m.id,
|
|
624
|
+
out.push({ id: m.id, channel, who: c.reviewer ?? 'theo', say: phrase('Review {what}'), what: `#${c.number}` });
|
|
625
625
|
else if (supervised && c && agent(m.who) && !list.slice(i + 1).some((n) => !agent(n.who))) {
|
|
626
|
-
const owner = orgOf(
|
|
627
|
-
out.push({ id: m.id,
|
|
626
|
+
const owner = orgOf(channel).people[0];
|
|
627
|
+
out.push({ id: m.id, channel, who: owner, say: phrase('Approve {what}'), what: c.kind === 'file' ? c.name : c.kind === 'meeting' || c.kind === 'list' ? c.title : m.text });
|
|
628
628
|
}
|
|
629
629
|
});
|
|
630
630
|
}
|