@agentshouse/mdruntime 0.1.0-c26d7e158e11b → 0.1.0-c28842bf4495f
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 +21 -19
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +2 -21
- package/dist/act-lanes.d.ts +11 -14
- package/dist/act-lanes.d.ts.map +1 -1
- package/dist/act-lanes.js +53 -5
- package/dist/actions.d.ts +1 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +88 -47
- package/dist/adapter.d.ts +66 -14
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +0 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +0 -5
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +345 -0
- package/dist/change.d.ts +4 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +3 -0
- package/dist/chat-types.d.ts +0 -2
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +0 -2
- package/dist/client.d.ts +11 -10
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +14 -43
- package/dist/collection.d.ts +4 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +7 -0
- package/dist/column.d.ts +5 -0
- package/dist/column.d.ts.map +1 -0
- package/dist/column.js +9 -0
- package/dist/compile.d.ts +2 -0
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +17 -5
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +9 -12
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/conversation-live.d.ts +18 -6
- package/dist/conversation-live.d.ts.map +1 -1
- package/dist/conversation-live.js +16 -6
- package/dist/conversation-row.d.ts +8 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +20 -7
- package/dist/conversation.d.ts +19 -7
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +225 -164
- package/dist/discovery.d.ts +1 -0
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +9 -5
- package/dist/download.d.ts +6 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +42 -0
- package/dist/durability.d.ts +2 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +7 -0
- package/dist/entry.js +1 -1
- package/dist/expectation.d.ts +25 -14
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +51 -20
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +3 -1
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +4 -2
- package/dist/file.d.ts +1 -1
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -2
- package/dist/host.d.ts +1 -0
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +27 -11
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/install.d.ts +9 -3
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +44 -46
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +17 -14
- package/dist/listing.d.ts +7 -3
- package/dist/listing.d.ts.map +1 -1
- package/dist/listing.js +26 -13
- package/dist/live.d.ts +5 -3
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +71 -30
- package/dist/loaded.d.ts +5 -0
- package/dist/loaded.d.ts.map +1 -0
- package/dist/loaded.js +40 -0
- package/dist/locks.d.ts.map +1 -1
- package/dist/locks.js +2 -3
- package/dist/lost.d.ts.map +1 -1
- package/dist/lost.js +2 -3
- package/dist/media.d.ts +18 -1
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +102 -24
- package/dist/memory.d.ts +5 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +58 -14
- package/dist/messages.d.ts +12 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +20 -10
- package/dist/modal.d.ts +2 -0
- package/dist/modal.d.ts.map +1 -0
- package/dist/modal.js +11 -0
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +5 -8
- package/dist/observation.d.ts +27 -12
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +173 -69
- package/dist/opening.d.ts.map +1 -1
- package/dist/opening.js +3 -9
- package/dist/outcome.d.ts +10 -1
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +17 -2
- package/dist/overlay.d.ts +4 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +11 -9
- package/dist/parts.d.ts +2 -9
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +6 -14
- package/dist/preparation.d.ts +27 -6
- package/dist/preparation.d.ts.map +1 -1
- package/dist/preparation.js +137 -56
- package/dist/presence.d.ts +8 -2
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js +24 -13
- package/dist/queries.d.ts +1 -1
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +62 -24
- package/dist/questions.d.ts +1 -5
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +1 -7
- package/dist/queue.d.ts +2 -2
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +73 -48
- package/dist/reach.d.ts +2 -3
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +66 -22
- package/dist/react.d.ts +10 -11
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +22 -4
- package/dist/readiness.d.ts +9 -3
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +3 -5
- package/dist/reads.d.ts +1 -1
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +2 -2
- package/dist/recovery.d.ts +3 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +29 -7
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +1 -3
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +2 -2
- package/dist/room-draft.d.ts +30 -5
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +253 -30
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +5 -2
- package/dist/room-list.d.ts +10 -0
- package/dist/room-list.d.ts.map +1 -0
- package/dist/room-list.js +45 -0
- package/dist/rows.d.ts +2 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +6 -6
- package/dist/runtime.d.ts +0 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/save.d.ts +1 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +105 -124
- package/dist/saves.d.ts +2 -0
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +42 -18
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +2 -2
- package/dist/shown.d.ts +5 -2
- package/dist/shown.d.ts.map +1 -1
- package/dist/shown.js +62 -39
- package/dist/socket/lanes.d.ts +10 -3
- package/dist/socket/lanes.d.ts.map +1 -1
- package/dist/socket/lanes.js +29 -6
- package/dist/socket.d.ts +2 -3
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +2 -9
- package/dist/source.d.ts +5 -7
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +13 -2
- package/dist/store/installs.d.ts +2 -2
- package/dist/store/installs.d.ts.map +1 -1
- package/dist/store/installs.js +10 -4
- package/dist/store/readiness.d.ts +5 -4
- package/dist/store/readiness.d.ts.map +1 -1
- package/dist/store/readiness.js +28 -12
- package/dist/store/records.d.ts +17 -5
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +58 -22
- package/dist/store/rooms-shown.d.ts +8 -0
- package/dist/store/rooms-shown.d.ts.map +1 -0
- package/dist/store/rooms-shown.js +13 -0
- package/dist/store.d.ts +13 -9
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +8 -4
- package/dist/stored.d.ts +24 -13
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +78 -27
- package/dist/surface.d.ts +8 -4
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +48 -20
- package/dist/sync.d.ts +1 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +14 -16
- package/dist/tables.d.ts +16 -52
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +86 -324
- package/dist/tallies.d.ts.map +1 -1
- package/dist/tallies.js +1 -2
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +3 -9
- package/dist/wire.d.ts +25 -10
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +9 -3
- package/package.json +3 -3
- package/dist/log.d.ts +0 -6
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
package/dist/conversation.js
CHANGED
|
@@ -6,7 +6,7 @@ import { heldFacts } from './conversation-row.js';
|
|
|
6
6
|
import { runtimeError, uncaught } from './failure.js';
|
|
7
7
|
import { refusedForSpace } from './durability.js';
|
|
8
8
|
import { changeBatchIdentity, chatDraftRevision } from './identity.js';
|
|
9
|
-
import { OFFLINE } from './outcome.js';
|
|
9
|
+
import { OFFLINE, } from './outcome.js';
|
|
10
10
|
import { runningLine } from './parts.js';
|
|
11
11
|
import { record, text } from './read.js';
|
|
12
12
|
import { openQuestion, questionAsked } from './questions.js';
|
|
@@ -29,12 +29,13 @@ export function unheldView(conversation) {
|
|
|
29
29
|
deliveryWaiting: [],
|
|
30
30
|
deliveryUnknown: [],
|
|
31
31
|
chatDraft: null,
|
|
32
|
+
dismissedSuggestion: null,
|
|
33
|
+
pins: [],
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
36
|
export const SESSION_STARTED = 'Session started';
|
|
35
37
|
const NEW_CHAT = 'new:';
|
|
36
38
|
const LISTING = 'listing';
|
|
37
|
-
const AGENTS = 'agents';
|
|
38
39
|
export const CATCHING_UP = 'catching-up';
|
|
39
40
|
export const HISTORY_CONVERSATIONS = 64;
|
|
40
41
|
export function newChat(agent) {
|
|
@@ -198,17 +199,17 @@ function withSubmitted(draft, submitted) {
|
|
|
198
199
|
const { submitted: _held, ...unsent } = draft;
|
|
199
200
|
return submitted.length === 0 ? unsent : { ...unsent, submitted };
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
-
return
|
|
202
|
+
export function joinedDraft(first, second) {
|
|
203
|
+
return [first, second].filter((one) => one !== '').join('\n');
|
|
203
204
|
}
|
|
204
205
|
function returned(draft, submission, others) {
|
|
205
206
|
return withSubmitted({
|
|
206
207
|
conversation: draft.conversation,
|
|
207
|
-
|
|
208
|
+
text: joinedDraft(submission.text, draft.text),
|
|
208
209
|
revision: chatDraftRevision(),
|
|
209
210
|
}, others);
|
|
210
211
|
}
|
|
211
|
-
function viewOf(alive, conversation, held, frame, draft, ended) {
|
|
212
|
+
function viewOf(alive, conversation, held, frame, { draft, ended, dismissed, pins }) {
|
|
212
213
|
const facts = alive.liveOf(conversation);
|
|
213
214
|
return {
|
|
214
215
|
conversation,
|
|
@@ -231,6 +232,8 @@ function viewOf(alive, conversation, held, frame, draft, ended) {
|
|
|
231
232
|
deliveryWaiting: [...facts.deliveryWaiting],
|
|
232
233
|
deliveryUnknown: [...facts.deliveryUnknown],
|
|
233
234
|
chatDraft: draft === null || unwritten(draft) ? null : { text: draft.text, revision: draft.revision },
|
|
235
|
+
dismissedSuggestion: dismissed,
|
|
236
|
+
pins: [...pins],
|
|
234
237
|
};
|
|
235
238
|
}
|
|
236
239
|
function sessionOf(facts, held, ended) {
|
|
@@ -250,13 +253,15 @@ function emit(alive, conversation) {
|
|
|
250
253
|
if (alive.deps.closed())
|
|
251
254
|
return;
|
|
252
255
|
for (const view of alive.views()) {
|
|
253
|
-
const
|
|
256
|
+
const held = view.held.now();
|
|
257
|
+
const { window } = held;
|
|
254
258
|
if (view.conversation !== conversation || window === null)
|
|
255
259
|
continue;
|
|
256
260
|
const ready = view.ready();
|
|
257
261
|
if (ready.length === 0)
|
|
258
262
|
continue;
|
|
259
|
-
const
|
|
263
|
+
const frame = sharedFrame(view, window);
|
|
264
|
+
const value = viewOf(alive, conversation, window, frame, held);
|
|
260
265
|
for (const watcher of ready)
|
|
261
266
|
watcher.notify(value);
|
|
262
267
|
}
|
|
@@ -302,66 +307,90 @@ function rowOf(alive, conversation) {
|
|
|
302
307
|
};
|
|
303
308
|
}
|
|
304
309
|
async function entries(alive) {
|
|
305
|
-
const
|
|
306
|
-
if (
|
|
310
|
+
const listing = await heldListing(alive);
|
|
311
|
+
if (listing === null)
|
|
312
|
+
return null;
|
|
313
|
+
const list = listing.conversations;
|
|
314
|
+
const agents = new Map(listing.agents.map((agent) => [agent.id, agent]));
|
|
315
|
+
if (list.some((entry) => !agents.has(entry.agent)))
|
|
307
316
|
return null;
|
|
308
317
|
const held = list.length === 0
|
|
309
318
|
? []
|
|
310
319
|
: await alive.deps.durably((local) => local.conversationRows(list.map(({ conversation }) => conversation)));
|
|
311
320
|
const rows = new Map(held.map((one) => [one.conversation, one]));
|
|
312
|
-
return list.map((entry) =>
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
return list.map((entry) => {
|
|
322
|
+
const agent = agents.get(entry.agent);
|
|
323
|
+
return {
|
|
324
|
+
conversation: entry.conversation,
|
|
325
|
+
agent: { identity: agent.id, name: agent.name, retired: agent.retired_at !== null },
|
|
326
|
+
name: entry.name,
|
|
327
|
+
created: entry.created,
|
|
328
|
+
finished: entry.finished,
|
|
329
|
+
outcome: entry.outcome,
|
|
330
|
+
waiting: entry.waiting,
|
|
331
|
+
subject: entry.subject,
|
|
332
|
+
...rowOf(alive, entry.conversation),
|
|
333
|
+
...heldFacts(rows.get(entry.conversation), entry),
|
|
334
|
+
};
|
|
335
|
+
});
|
|
323
336
|
}
|
|
324
|
-
async function
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
327
|
-
return
|
|
328
|
-
return !alive.known() && alive.deps.stream() !== undefined && alive.deps.online()
|
|
337
|
+
async function heldListing(alive) {
|
|
338
|
+
const { conversationList, agentList } = await (await alive.deps.local()).facts();
|
|
339
|
+
if (conversationList !== null && agentList !== null)
|
|
340
|
+
return { conversations: conversationList, agents: agentList };
|
|
341
|
+
return !alive.known() && alive.deps.stream() !== undefined && alive.deps.online()
|
|
342
|
+
? null
|
|
343
|
+
: { conversations: [], agents: [] };
|
|
329
344
|
}
|
|
330
345
|
async function endedIn(alive, conversation) {
|
|
331
|
-
const
|
|
332
|
-
return
|
|
346
|
+
const listing = await heldListing(alive);
|
|
347
|
+
return (listing?.conversations.find((entry) => entry.conversation === conversation)?.processEnded ??
|
|
348
|
+
null);
|
|
349
|
+
}
|
|
350
|
+
function upserted(kept, set, key) {
|
|
351
|
+
const held = new Map(kept.map((one) => [key(one), one]));
|
|
352
|
+
for (const one of set)
|
|
353
|
+
held.set(key(one), { ...one });
|
|
354
|
+
return held;
|
|
333
355
|
}
|
|
334
356
|
function listChanged(alive, change) {
|
|
335
357
|
void alive.deps
|
|
336
358
|
.durably(async (local) => {
|
|
337
|
-
const { conversationList, conversationCursor } = await local.facts();
|
|
338
|
-
const
|
|
339
|
-
const
|
|
340
|
-
for (const entry of change.set) {
|
|
341
|
-
held.set(entry.conversation, { ...entry });
|
|
359
|
+
const { conversationList, agentList, conversationCursor } = await local.facts();
|
|
360
|
+
const held = upserted(change.replacing ? [] : (conversationList ?? []), change.set, (entry) => entry.conversation);
|
|
361
|
+
for (const entry of change.set)
|
|
342
362
|
alive.created(entry.conversation);
|
|
343
|
-
}
|
|
344
363
|
if (change.gone !== null)
|
|
345
364
|
held.delete(change.gone);
|
|
346
365
|
const list = [...held.values()];
|
|
366
|
+
const agents = [
|
|
367
|
+
...upserted(change.replacing ? [] : (agentList ?? []), change.agents, (agent) => agent.id).values(),
|
|
368
|
+
];
|
|
347
369
|
if (JSON.stringify(list) !== JSON.stringify(conversationList)) {
|
|
348
370
|
await local.fact('conversationList', list);
|
|
349
371
|
}
|
|
372
|
+
if (JSON.stringify(agents) !== JSON.stringify(agentList)) {
|
|
373
|
+
await local.fact('agentList', agents);
|
|
374
|
+
}
|
|
350
375
|
if (change.cursor !== undefined) {
|
|
351
376
|
if (change.cursor !== conversationCursor) {
|
|
352
377
|
await local.fact('conversationCursor', change.cursor);
|
|
353
378
|
}
|
|
354
379
|
alive.deps.stream()?.hold(change.cursor);
|
|
355
380
|
}
|
|
356
|
-
return list;
|
|
381
|
+
return { conversations: list, agents };
|
|
357
382
|
})
|
|
358
|
-
.catch(async () =>
|
|
359
|
-
.
|
|
383
|
+
.catch(async () => {
|
|
384
|
+
const { conversationList, agentList } = await (await alive.deps.local()).facts();
|
|
385
|
+
return { conversations: conversationList ?? [], agents: agentList ?? [] };
|
|
386
|
+
})
|
|
387
|
+
.then((listing) => {
|
|
360
388
|
if (alive.deps.closed() || change.paged === true)
|
|
361
389
|
return;
|
|
390
|
+
const list = listing.conversations;
|
|
362
391
|
endedAnew(alive, list);
|
|
363
392
|
if (change.cursor !== undefined) {
|
|
364
|
-
alive.held.set({ listKnown: true });
|
|
393
|
+
alive.held.set({ listKnown: true, openingListed: true });
|
|
365
394
|
settleBehind(alive, list);
|
|
366
395
|
openingEnded(alive);
|
|
367
396
|
alive.deps.settled();
|
|
@@ -369,11 +398,12 @@ function listChanged(alive, change) {
|
|
|
369
398
|
emitList(alive);
|
|
370
399
|
if (!alive.known())
|
|
371
400
|
return;
|
|
372
|
-
retiredDrafts(alive,
|
|
373
|
-
const { replicated } = alive.held.now();
|
|
374
|
-
if (change.cursor === undefined
|
|
375
|
-
|
|
376
|
-
list.some(({ conversation }) => !replicated.has(conversation))
|
|
401
|
+
retiredDrafts(alive, listing);
|
|
402
|
+
const { replicated, openingRead } = alive.held.now();
|
|
403
|
+
if (change.cursor === undefined
|
|
404
|
+
? list.length !== replicated.size ||
|
|
405
|
+
list.some(({ conversation }) => !replicated.has(conversation))
|
|
406
|
+
: openingRead) {
|
|
377
407
|
alive.deps.again();
|
|
378
408
|
}
|
|
379
409
|
}, uncaught);
|
|
@@ -389,23 +419,23 @@ function endedAnew(alive, list) {
|
|
|
389
419
|
emit(alive, view.conversation);
|
|
390
420
|
}
|
|
391
421
|
}
|
|
392
|
-
function
|
|
393
|
-
const reading =
|
|
422
|
+
function shownListing(alive, work) {
|
|
423
|
+
const reading = heldListing(alive);
|
|
394
424
|
alive.inOrder(async () => {
|
|
395
|
-
const
|
|
425
|
+
const listing = await reading.catch((error) => {
|
|
396
426
|
uncaught(error);
|
|
397
427
|
return null;
|
|
398
428
|
});
|
|
399
|
-
if (
|
|
429
|
+
if (listing === null || alive.deps.closed())
|
|
400
430
|
return;
|
|
401
|
-
work(
|
|
431
|
+
work(listing);
|
|
402
432
|
});
|
|
403
433
|
}
|
|
404
434
|
async function told(alive) {
|
|
405
435
|
try {
|
|
406
436
|
while (alive.held.now().listOwed && !alive.deps.closed()) {
|
|
407
437
|
alive.held.set({ listOwed: false });
|
|
408
|
-
const value = await untilAnswered(retrying(alive.deps.retries, 'conversations', LISTING, () => entries(alive)), alive.closing);
|
|
438
|
+
const value = await untilAnswered(retrying(alive.deps.retries, 'conversations', LISTING, () => entries(alive)), alive.closing, () => true, alive.deps.recovery);
|
|
409
439
|
if (alive.deps.closed())
|
|
410
440
|
return;
|
|
411
441
|
if (value === null)
|
|
@@ -443,66 +473,48 @@ export function conversationsLearned(alive) {
|
|
|
443
473
|
return;
|
|
444
474
|
if (alive.listeners.waiting())
|
|
445
475
|
tellList(alive);
|
|
446
|
-
if (!alive.agentListeners.waiting())
|
|
476
|
+
if (!alive.agentListeners.waiting() && !alive.listedListeners.waiting())
|
|
447
477
|
return;
|
|
448
|
-
|
|
478
|
+
shownListing(alive, (listing) => {
|
|
479
|
+
alive.agentListeners.welcome(agentsOf(listing));
|
|
480
|
+
alive.listedListeners.welcome(structuredClone(listing.agents));
|
|
481
|
+
});
|
|
449
482
|
}
|
|
450
|
-
function
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
.
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
:
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
cli: held.cli,
|
|
466
|
-
environment: structuredClone(held.environment),
|
|
467
|
-
};
|
|
468
|
-
})
|
|
483
|
+
function agentsOf(listing) {
|
|
484
|
+
return listing.agents
|
|
485
|
+
.filter((agent) => agent.retired_at === null)
|
|
486
|
+
.map((agent) => ({
|
|
487
|
+
identity: agent.id,
|
|
488
|
+
name: agent.name,
|
|
489
|
+
cli: agent.cli,
|
|
490
|
+
model: agent.model,
|
|
491
|
+
effort: agent.effort,
|
|
492
|
+
environment: {
|
|
493
|
+
identity: agent.environment,
|
|
494
|
+
name: agent.environment_name,
|
|
495
|
+
state: agent.environment_connected ? 'online' : 'offline',
|
|
496
|
+
},
|
|
497
|
+
}))
|
|
469
498
|
.sort((left, right) => left.name === right.name
|
|
470
499
|
? left.identity.localeCompare(right.identity)
|
|
471
500
|
: left.name.localeCompare(right.name));
|
|
472
501
|
}
|
|
473
|
-
function readAgents(alive) {
|
|
474
|
-
const stream = alive.deps.stream();
|
|
475
|
-
if (stream?.agents === undefined || !alive.deps.online() || alive.held.now().agentsReading)
|
|
476
|
-
return;
|
|
477
|
-
const { agents: read } = stream;
|
|
478
|
-
const { agentListeners } = alive;
|
|
479
|
-
alive.held.set({ agentsReading: true });
|
|
480
|
-
void alive.deps.recovery
|
|
481
|
-
.attempt('agents', async () => {
|
|
482
|
-
if (!alive.deps.online() || (!agentListeners.waiting() && !agentListeners.told())) {
|
|
483
|
-
return 'done';
|
|
484
|
-
}
|
|
485
|
-
const listed = await retrying(alive.deps.retries, 'conversations', AGENTS, read)();
|
|
486
|
-
if (listed === null)
|
|
487
|
-
return 'done';
|
|
488
|
-
alive.held.set({ listedAgents: listed });
|
|
489
|
-
emitAgents(alive);
|
|
490
|
-
return 'done';
|
|
491
|
-
})
|
|
492
|
-
.finally(() => {
|
|
493
|
-
alive.held.set({ agentsReading: false });
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
502
|
function emitAgents(alive) {
|
|
497
|
-
|
|
503
|
+
const { agentListeners, listedListeners } = alive;
|
|
504
|
+
if (alive.deps.closed() || (!agentListeners.told() && !listedListeners.told()))
|
|
498
505
|
return;
|
|
499
|
-
|
|
500
|
-
const value =
|
|
506
|
+
shownListing(alive, (listing) => {
|
|
507
|
+
const value = agentsOf(listing);
|
|
501
508
|
const shown = JSON.stringify(value);
|
|
502
|
-
if (shown
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
509
|
+
if (shown !== alive.held.now().agentsShown) {
|
|
510
|
+
alive.held.set({ agentsShown: shown });
|
|
511
|
+
agentListeners.tell(value);
|
|
512
|
+
}
|
|
513
|
+
const listed = JSON.stringify(listing.agents);
|
|
514
|
+
if (listed !== alive.held.now().listedShown) {
|
|
515
|
+
alive.held.set({ listedShown: listed });
|
|
516
|
+
listedListeners.tell(structuredClone(listing.agents));
|
|
517
|
+
}
|
|
506
518
|
});
|
|
507
519
|
}
|
|
508
520
|
function setLive(alive, conversation, next) {
|
|
@@ -516,11 +528,11 @@ function setLive(alive, conversation, next) {
|
|
|
516
528
|
after.asked !== before.asked)
|
|
517
529
|
tellSoon(alive);
|
|
518
530
|
}
|
|
519
|
-
function retiredChat(conversation,
|
|
531
|
+
function retiredChat(conversation, listing) {
|
|
520
532
|
if (!conversation.startsWith(NEW_CHAT))
|
|
521
533
|
return false;
|
|
522
534
|
const agent = conversation.slice(NEW_CHAT.length);
|
|
523
|
-
return
|
|
535
|
+
return listing.agents.some((one) => one.id === agent && one.retired_at !== null);
|
|
524
536
|
}
|
|
525
537
|
function live(alive, conversation, change) {
|
|
526
538
|
alive.factsHeard(conversation, FACTS.filter((one) => one in change));
|
|
@@ -573,19 +585,13 @@ function handReplicated(alive) {
|
|
|
573
585
|
}
|
|
574
586
|
async function remove(alive, leaving) {
|
|
575
587
|
await alive.deps.durably(async (local) => {
|
|
576
|
-
const kept = new Set(
|
|
577
|
-
...(await local.conversations(leaving)).map(({ conversation }) => conversation),
|
|
578
|
-
...(await local.chatDrafts())
|
|
579
|
-
.filter(({ conversation }) => leaving.includes(conversation))
|
|
580
|
-
.map(({ conversation }) => conversation),
|
|
581
|
-
]);
|
|
582
|
-
await local.dropConversations(leaving);
|
|
588
|
+
const kept = new Set(await local.dropConversations(leaving));
|
|
583
589
|
const changed = [];
|
|
584
590
|
for (const conversation of leaving) {
|
|
585
591
|
if (kept.has(conversation) || alive.liveHeld(conversation) !== undefined) {
|
|
586
592
|
changed.push(conversation);
|
|
587
593
|
}
|
|
588
|
-
|
|
594
|
+
heldInViews(alive, conversation, { draft: null, dismissed: null });
|
|
589
595
|
alive.forget(conversation);
|
|
590
596
|
setLive(alive, conversation, null);
|
|
591
597
|
await slide(alive, local, conversation, null);
|
|
@@ -614,7 +620,7 @@ async function readsOf(local, conversations) {
|
|
|
614
620
|
return new Map((await local.conversations(conversations)).map((held) => [held.conversation, held]));
|
|
615
621
|
}
|
|
616
622
|
function retiredDrafts(alive, list) {
|
|
617
|
-
if (!list.some((
|
|
623
|
+
if (!list.agents.some((agent) => agent.retired_at !== null))
|
|
618
624
|
return;
|
|
619
625
|
void alive.deps
|
|
620
626
|
.local()
|
|
@@ -810,19 +816,27 @@ function heard(alive, event) {
|
|
|
810
816
|
emit(alive, conversation);
|
|
811
817
|
}
|
|
812
818
|
async function kept(alive, local, conversation, following) {
|
|
813
|
-
const
|
|
814
|
-
if (
|
|
819
|
+
const draft = following === null || empty(following) ? null : following;
|
|
820
|
+
if (draft === null)
|
|
815
821
|
await local.dropChatDraft(conversation);
|
|
816
822
|
else
|
|
817
|
-
await local.keepChatDrafts([
|
|
818
|
-
|
|
823
|
+
await local.keepChatDrafts([draft]);
|
|
824
|
+
heldInViews(alive, conversation, { draft });
|
|
819
825
|
}
|
|
820
|
-
function
|
|
826
|
+
function heldInViews(alive, conversation, held) {
|
|
821
827
|
for (const view of alive.views()) {
|
|
822
828
|
if (view.conversation === conversation)
|
|
823
|
-
view.held.set(
|
|
829
|
+
view.held.set(held);
|
|
824
830
|
}
|
|
825
831
|
}
|
|
832
|
+
async function factOf(local, name) {
|
|
833
|
+
return Object.fromEntries((await local.conversationFacts())
|
|
834
|
+
.filter((fact) => fact.name === name)
|
|
835
|
+
.map(({ conversation, value }) => [conversation, value]));
|
|
836
|
+
}
|
|
837
|
+
async function dismissedIn(local, conversation) {
|
|
838
|
+
return (await factOf(local, 'dismissedSuggestion'))[conversation] ?? null;
|
|
839
|
+
}
|
|
826
840
|
async function draftAt(local, conversation) {
|
|
827
841
|
return (await local.chatDraft(conversation)) ?? undefined;
|
|
828
842
|
}
|
|
@@ -853,9 +867,9 @@ function moved(alive, agent, operation, to) {
|
|
|
853
867
|
: [{ ...unsent, conversation: to }];
|
|
854
868
|
const left = { ...(taken.length === 0 ? unsent : blank), moves: [...earlier, operation] };
|
|
855
869
|
await local.keepChatDrafts([left, ...taken]);
|
|
856
|
-
|
|
870
|
+
heldInViews(alive, from, { draft: left });
|
|
857
871
|
for (const one of taken)
|
|
858
|
-
|
|
872
|
+
heldInViews(alive, to, { draft: one });
|
|
859
873
|
alive.deps.publish(conversationChangeSet([from, to]));
|
|
860
874
|
});
|
|
861
875
|
}
|
|
@@ -886,7 +900,7 @@ async function submitted(alive, conversation, operation, draft) {
|
|
|
886
900
|
});
|
|
887
901
|
return submission;
|
|
888
902
|
}
|
|
889
|
-
async function dispatched(alive, conversation, submission) {
|
|
903
|
+
async function dispatched(alive, conversation, submission, resent = false) {
|
|
890
904
|
const dispatch = alive.sendingBegan(submission.operation);
|
|
891
905
|
try {
|
|
892
906
|
const result = await invoke(alive, 'conversations/send', conversation, submission.operation, { text: submission.text }, { step: 'sending', instance: `message ${submission.operation}` });
|
|
@@ -897,6 +911,7 @@ async function dispatched(alive, conversation, submission) {
|
|
|
897
911
|
alive.deps.unanswered();
|
|
898
912
|
return result;
|
|
899
913
|
}
|
|
914
|
+
alive.deps.heard(submission.operation, resent);
|
|
900
915
|
const turn = answered(result, 'message_id');
|
|
901
916
|
await withDraft(alive, conversation, async (current, local) => {
|
|
902
917
|
const held = current?.submitted?.find((one) => one.operation === submission.operation);
|
|
@@ -919,8 +934,9 @@ async function dispatched(alive, conversation, submission) {
|
|
|
919
934
|
function invoke(alive, name, conversation, operation, extra = {}, attempt) {
|
|
920
935
|
return alive.deps.call(name, { conversation_id: conversation, operation_id: operation, ...extra }, attempt);
|
|
921
936
|
}
|
|
922
|
-
export function conversationSurface(alive) {
|
|
937
|
+
export function conversationSurface(alive, files) {
|
|
923
938
|
return {
|
|
939
|
+
...files,
|
|
924
940
|
list() {
|
|
925
941
|
return new Promise((settle) => {
|
|
926
942
|
const answer = (listed) => {
|
|
@@ -938,7 +954,12 @@ export function conversationSurface(alive) {
|
|
|
938
954
|
return alive.deps.durably(async (local) => {
|
|
939
955
|
const { messages, more } = await local.messageWindow(conversation, asked.limit, asked.before, phrase);
|
|
940
956
|
const total = asked.total ? await local.messageCount(conversation, phrase) : null;
|
|
941
|
-
return structuredClone(viewOf(alive, conversation, messages, frameOf(asked, messages, more, total),
|
|
957
|
+
return structuredClone(viewOf(alive, conversation, messages, frameOf(asked, messages, more, total), {
|
|
958
|
+
draft: (await local.chatDraft(conversation)) ?? null,
|
|
959
|
+
ended: await endedIn(alive, conversation),
|
|
960
|
+
dismissed: await dismissedIn(local, conversation),
|
|
961
|
+
pins: (await local.facts()).chatPins,
|
|
962
|
+
}));
|
|
942
963
|
});
|
|
943
964
|
},
|
|
944
965
|
async create(input) {
|
|
@@ -946,7 +967,7 @@ export function conversationSurface(alive) {
|
|
|
946
967
|
const conversation = answered(result, 'conversation_id');
|
|
947
968
|
if (conversation === null)
|
|
948
969
|
return result;
|
|
949
|
-
const listed = (await
|
|
970
|
+
const listed = (await heldListing(alive))?.conversations ?? [];
|
|
950
971
|
if (!listed.some((entry) => entry.conversation === conversation)) {
|
|
951
972
|
alive.creating(conversation);
|
|
952
973
|
}
|
|
@@ -1012,40 +1033,53 @@ export function conversationSurface(alive) {
|
|
|
1012
1033
|
message_id: message,
|
|
1013
1034
|
});
|
|
1014
1035
|
},
|
|
1015
|
-
async
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1036
|
+
async pin(figures) {
|
|
1037
|
+
const pins = [...figures];
|
|
1038
|
+
await alive.deps.durably((local) => local.fact('chatPins', pins));
|
|
1039
|
+
const views = [...alive.views()];
|
|
1040
|
+
for (const view of views)
|
|
1041
|
+
view.held.set({ pins });
|
|
1042
|
+
for (const conversation of new Set(views.map((view) => view.conversation))) {
|
|
1043
|
+
emit(alive, conversation);
|
|
1044
|
+
}
|
|
1020
1045
|
},
|
|
1021
|
-
async
|
|
1022
|
-
|
|
1046
|
+
async openTurn(conversation, turn) {
|
|
1047
|
+
await alive.deps.durably((local) => local.keepConversationFact({ conversation, name: 'openedTurn', value: turn }));
|
|
1048
|
+
tellList(alive);
|
|
1023
1049
|
},
|
|
1024
|
-
|
|
1050
|
+
dismissSuggestion(conversation, suggestion) {
|
|
1025
1051
|
return alive.deps.durably(async (local) => {
|
|
1026
|
-
|
|
1027
|
-
|
|
1052
|
+
if ((await dismissedIn(local, conversation)) === suggestion)
|
|
1053
|
+
return;
|
|
1054
|
+
await local.keepConversationFact({
|
|
1055
|
+
conversation,
|
|
1056
|
+
name: 'dismissedSuggestion',
|
|
1057
|
+
value: suggestion,
|
|
1058
|
+
});
|
|
1059
|
+
heldInViews(alive, conversation, { dismissed: suggestion });
|
|
1060
|
+
alive.deps.publish(conversationChangeSet([conversation]));
|
|
1028
1061
|
});
|
|
1029
1062
|
},
|
|
1030
1063
|
};
|
|
1031
1064
|
}
|
|
1065
|
+
function rewritten(alive, conversation, text, revision = chatDraftRevision()) {
|
|
1066
|
+
return withDraft(alive, conversation, (current) => ({
|
|
1067
|
+
conversation,
|
|
1068
|
+
text: text(current?.text ?? ''),
|
|
1069
|
+
revision,
|
|
1070
|
+
...(current === undefined ? {} : pending(current)),
|
|
1071
|
+
}));
|
|
1072
|
+
}
|
|
1032
1073
|
export function chatDraftSurface(alive) {
|
|
1033
1074
|
return {
|
|
1034
|
-
write(conversation, draft, revision
|
|
1035
|
-
return
|
|
1036
|
-
conversation,
|
|
1037
|
-
text: draft.text,
|
|
1038
|
-
revision,
|
|
1039
|
-
...(current === undefined ? {} : pending(current)),
|
|
1040
|
-
}));
|
|
1075
|
+
write(conversation, draft, revision) {
|
|
1076
|
+
return rewritten(alive, conversation, () => draft.text, revision);
|
|
1041
1077
|
},
|
|
1042
1078
|
prepend(conversation, draft) {
|
|
1043
|
-
return
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
...(current === undefined ? {} : pending(current)),
|
|
1048
|
-
}));
|
|
1079
|
+
return rewritten(alive, conversation, (held) => joinedDraft(draft.text, held));
|
|
1080
|
+
},
|
|
1081
|
+
append(conversation, draft) {
|
|
1082
|
+
return rewritten(alive, conversation, (held) => joinedDraft(held, draft.text));
|
|
1049
1083
|
},
|
|
1050
1084
|
discard(conversation) {
|
|
1051
1085
|
return withDraft(alive, conversation, (current) => current === undefined
|
|
@@ -1055,31 +1089,34 @@ export function chatDraftSurface(alive) {
|
|
|
1055
1089
|
};
|
|
1056
1090
|
}
|
|
1057
1091
|
export async function conversationsOpened(alive, local) {
|
|
1058
|
-
const { conversationList, conversationCursor } = await local.facts();
|
|
1059
|
-
if (conversationList === null || alive.known())
|
|
1092
|
+
const { conversationList, agentList, conversationCursor } = await local.facts();
|
|
1093
|
+
if (conversationList === null || agentList === null || alive.known())
|
|
1060
1094
|
return;
|
|
1061
1095
|
alive.deps.stream()?.hold(conversationCursor);
|
|
1062
1096
|
conversationsLearned(alive);
|
|
1063
1097
|
}
|
|
1098
|
+
export function reconcileOpening(alive) {
|
|
1099
|
+
alive.held.set({ openingRead: true });
|
|
1100
|
+
return reconcileConversations(alive);
|
|
1101
|
+
}
|
|
1064
1102
|
export async function reconcileConversations(alive) {
|
|
1065
1103
|
if (!alive.known())
|
|
1066
1104
|
return;
|
|
1067
1105
|
const local = await alive.deps.local();
|
|
1068
|
-
const [held,
|
|
1106
|
+
const [held, stored, { conversationList, agentList }] = await Promise.all([
|
|
1069
1107
|
local.conversations(),
|
|
1070
|
-
local.
|
|
1108
|
+
local.storedConversations(),
|
|
1071
1109
|
local.facts(),
|
|
1072
1110
|
]);
|
|
1073
1111
|
const list = conversationList ?? [];
|
|
1112
|
+
const listing = { conversations: list, agents: agentList ?? [] };
|
|
1074
1113
|
const entries = new Map(list.map((entry) => [entry.conversation, entry]));
|
|
1075
1114
|
const named = new Set(entries.keys());
|
|
1076
1115
|
const reads = new Map(held.map((one) => [one.conversation, one]));
|
|
1077
1116
|
const { replicated } = alive.held.now();
|
|
1078
|
-
const leaving = [
|
|
1079
|
-
...new Set([...replicated, ...reads.keys(), ...kept.map(({ conversation }) => conversation)]),
|
|
1080
|
-
].filter((conversation) => !named.has(conversation) &&
|
|
1117
|
+
const leaving = [...new Set([...replicated, ...stored])].filter((conversation) => !named.has(conversation) &&
|
|
1081
1118
|
!alive.isCreating(conversation) &&
|
|
1082
|
-
(!conversation.startsWith(NEW_CHAT) || retiredChat(conversation,
|
|
1119
|
+
(!conversation.startsWith(NEW_CHAT) || retiredChat(conversation, listing)));
|
|
1083
1120
|
for (const conversation of named) {
|
|
1084
1121
|
if (!replicated.has(conversation) &&
|
|
1085
1122
|
missed(alive, conversation, reads.get(conversation), entries.get(conversation))) {
|
|
@@ -1114,6 +1151,17 @@ export async function catchUpConversations(alive, progress) {
|
|
|
1114
1151
|
if (!alive.current())
|
|
1115
1152
|
progress.complete = false;
|
|
1116
1153
|
}
|
|
1154
|
+
export async function holdsSubmission(alive, operation) {
|
|
1155
|
+
if (alive.sending(operation))
|
|
1156
|
+
return true;
|
|
1157
|
+
const local = await alive.deps.local();
|
|
1158
|
+
for (const { conversation } of await local.chatDrafts()) {
|
|
1159
|
+
const held = (await local.chatDraft(conversation))?.submitted;
|
|
1160
|
+
if (held?.some((one) => one.operation === operation && one.turn === null) === true)
|
|
1161
|
+
return true;
|
|
1162
|
+
}
|
|
1163
|
+
return false;
|
|
1164
|
+
}
|
|
1117
1165
|
export async function resendConversations(alive, progress) {
|
|
1118
1166
|
const local = await alive.deps.local();
|
|
1119
1167
|
const tried = new Set();
|
|
@@ -1125,7 +1173,7 @@ export async function resendConversations(alive, progress) {
|
|
|
1125
1173
|
if (alive.deps.closed())
|
|
1126
1174
|
return;
|
|
1127
1175
|
tried.add(submission.operation);
|
|
1128
|
-
const result = await dispatched(alive, conversation, submission);
|
|
1176
|
+
const result = await dispatched(alive, conversation, submission, true);
|
|
1129
1177
|
if (result.kind === 'revoked-authorization')
|
|
1130
1178
|
return;
|
|
1131
1179
|
if (result.kind === 'transport-uncertainty') {
|
|
@@ -1151,6 +1199,8 @@ export function watchConversation(alive, conversation, options, deliver) {
|
|
|
1151
1199
|
const { messages, more } = await local.messageWindow(conversation, asked.limit, asked.before);
|
|
1152
1200
|
held.set({ draft: (await local.chatDraft(conversation)) ?? null });
|
|
1153
1201
|
held.set({ ended: await endedIn(alive, conversation) });
|
|
1202
|
+
held.set({ dismissed: await dismissedIn(local, conversation) });
|
|
1203
|
+
held.set({ pins: (await local.facts()).chatPins });
|
|
1154
1204
|
held.set({ window: messages });
|
|
1155
1205
|
held.set({ more });
|
|
1156
1206
|
held.set({ total: asked.total ? await local.messageCount(conversation) : null });
|
|
@@ -1158,9 +1208,10 @@ export function watchConversation(alive, conversation, options, deliver) {
|
|
|
1158
1208
|
.then(() => {
|
|
1159
1209
|
if (alive.deps.closed() || !view.admit(watcher))
|
|
1160
1210
|
return;
|
|
1161
|
-
const
|
|
1162
|
-
const shown = window ?? [];
|
|
1163
|
-
|
|
1211
|
+
const now = held.now();
|
|
1212
|
+
const shown = now.window ?? [];
|
|
1213
|
+
const frame = sharedFrame(view, shown);
|
|
1214
|
+
watcher.notify(viewOf(alive, conversation, shown, frame, now));
|
|
1164
1215
|
})
|
|
1165
1216
|
.catch(() => { });
|
|
1166
1217
|
return () => {
|
|
@@ -1176,9 +1227,13 @@ export function watchConversationList(alive, deliver) {
|
|
|
1176
1227
|
export function watchConversationAgents(alive, deliver) {
|
|
1177
1228
|
alive.agentListeners.join(deliver);
|
|
1178
1229
|
conversationsLearned(alive);
|
|
1179
|
-
readAgents(alive);
|
|
1180
1230
|
return () => alive.agentListeners.leave(deliver);
|
|
1181
1231
|
}
|
|
1232
|
+
export function watchListedAgents(alive, deliver) {
|
|
1233
|
+
alive.listedListeners.join(deliver);
|
|
1234
|
+
conversationsLearned(alive);
|
|
1235
|
+
return () => alive.listedListeners.leave(deliver);
|
|
1236
|
+
}
|
|
1182
1237
|
export function conversationsChanged(alive, set) {
|
|
1183
1238
|
for (const conversation of set.conversations)
|
|
1184
1239
|
emit(alive, conversation);
|
|
@@ -1190,26 +1245,32 @@ export function receiveConversationEvent(alive, event) {
|
|
|
1190
1245
|
if (event.whole)
|
|
1191
1246
|
alive.relistBegun();
|
|
1192
1247
|
if (alive.relisting())
|
|
1193
|
-
alive.relistHeard(event.entries);
|
|
1248
|
+
alive.relistHeard(event.entries, event.agents);
|
|
1194
1249
|
if (event.more && alive.relisting())
|
|
1195
1250
|
return;
|
|
1196
1251
|
const whole = alive.relistTaken();
|
|
1197
1252
|
listChanged(alive, {
|
|
1198
1253
|
replacing: whole !== null,
|
|
1199
|
-
set: whole === null ? event.entries : [...whole.values()],
|
|
1254
|
+
set: whole === null ? event.entries : [...whole.conversations.values()],
|
|
1255
|
+
agents: whole === null ? event.agents : [...whole.agents.values()],
|
|
1200
1256
|
gone: null,
|
|
1201
1257
|
...(event.more ? { paged: true } : { cursor: event.cursor }),
|
|
1202
1258
|
});
|
|
1203
1259
|
return;
|
|
1204
1260
|
}
|
|
1205
1261
|
if (event.kind === 'listed') {
|
|
1206
|
-
alive.relistHeard([event.entry]);
|
|
1207
|
-
listChanged(alive, { replacing: false, set: [event.entry], gone: null });
|
|
1262
|
+
alive.relistHeard([event.entry], []);
|
|
1263
|
+
listChanged(alive, { replacing: false, set: [event.entry], agents: [], gone: null });
|
|
1264
|
+
return;
|
|
1265
|
+
}
|
|
1266
|
+
if (event.kind === 'agent') {
|
|
1267
|
+
alive.relistHeard([], [event.agent]);
|
|
1268
|
+
listChanged(alive, { replacing: false, set: [], agents: [event.agent], gone: null });
|
|
1208
1269
|
return;
|
|
1209
1270
|
}
|
|
1210
1271
|
if (event.kind === 'unlisted') {
|
|
1211
1272
|
alive.relistDropped(event.conversation);
|
|
1212
|
-
listChanged(alive, { replacing: false, set: [], gone: event.conversation });
|
|
1273
|
+
listChanged(alive, { replacing: false, set: [], agents: [], gone: event.conversation });
|
|
1213
1274
|
return;
|
|
1214
1275
|
}
|
|
1215
1276
|
heard(alive, event);
|