eve-hub 0.6.56 → 0.6.57

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # eve-hub
2
2
 
3
+ ## 0.6.57
4
+
5
+ ### Patch Changes
6
+
7
+ - Hosted hub: a thread's participants are read in rows that grow with the thread, not its square (a 650-message thread read 383,000 rows at every send and fold).
8
+
3
9
  ## 0.6.56
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve-hub",
3
- "version": "0.6.56",
3
+ "version": "0.6.57",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Bot-side code shared by every hub agent: registry tools, the roster hook, the eve channel, the host sandbox and browser, and model helpers.",
6
6
  "type": "module",
package/world.mjs CHANGED
@@ -20178,12 +20178,12 @@ function eventStatements(threadId2, event, text, at, id = eventId(), only) {
20178
20178
  // ../../hosted-hub/src/store/routing.ts
20179
20179
  var THREAD_REFS = 3;
20180
20180
  var threadArgs = (threadId2, ...rest) => [...Array(THREAD_REFS).fill(threadId2), ...rest];
20181
- var PARTICIPANTS = (thread, except = "''") => `SELECT DISTINCT p.bot FROM (
20182
- SELECT thread_id AS tid, bot, created_at AS at, NULL AS mid FROM sessions WHERE thread_id = ${thread}
20183
- UNION ALL SELECT thread_id, author, created_at, id FROM messages WHERE thread_id = ${thread} AND author_kind = 'agent'
20184
- UNION ALL SELECT thread_id, json_extract(event, '$.agent'), created_at, id FROM messages WHERE thread_id = ${thread} AND author_kind = 'event' AND json_extract(event, '$.kind') = 'join') p
20185
- WHERE p.mid IS NOT ${except} AND p.at > COALESCE((SELECT MAX(l.created_at) FROM messages l WHERE l.thread_id = p.tid AND l.author_kind = 'event'
20186
- AND json_extract(l.event, '$.kind') = 'leave' AND json_extract(l.event, '$.agent') = p.bot), -1)`;
20181
+ var PARTICIPANTS = (thread, except = "''") => `SELECT bot FROM (
20182
+ SELECT bot, created_at AS at, 0 AS leave, NULL AS mid FROM sessions WHERE thread_id = ${thread}
20183
+ UNION ALL SELECT author, created_at, 0, id FROM messages WHERE thread_id = ${thread} AND author_kind = 'agent'
20184
+ UNION ALL SELECT json_extract(event, '$.agent'), created_at, json_extract(event, '$.kind') = 'leave', id FROM messages
20185
+ WHERE thread_id = ${thread} AND author_kind = 'event' AND json_extract(event, '$.kind') IN ('join', 'leave'))
20186
+ GROUP BY bot HAVING MAX(CASE WHEN NOT leave AND mid IS NOT ${except} THEN at END) > COALESCE(MAX(CASE WHEN leave THEN at END), -1)`;
20187
20187
  var hasJoins = (threadId2) => !threadId2.startsWith("dm-") && !threadId2.startsWith("sch-");
20188
20188
  function routingStatements(messageId2, threadId2, bots, now, { by, joins }, held = {}, steer = false) {
20189
20189
  const quiet2 = !joins || !hasJoins(threadId2);