@agent-relay/dashboard 2.0.85 → 2.0.87

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.
Files changed (67) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/chunks/{1028-53c5a7e2453505f8.js → 1028-85d028e818d3ef30.js} +1 -1
  3. package/out/_next/static/chunks/3238-24c1e4b1cefe3c71.js +73 -0
  4. package/out/_next/static/chunks/app/app/[[...slug]]/{page-3dffd65b6344f53e.js → page-f33c6214e21ccfdd.js} +1 -1
  5. package/out/_next/static/chunks/app/{page-09ce10603ad9a251.js → page-2e38080856c3c293.js} +1 -1
  6. package/out/about.html +1 -1
  7. package/out/about.txt +1 -1
  8. package/out/app/onboarding.html +1 -1
  9. package/out/app/onboarding.txt +1 -1
  10. package/out/app.html +1 -1
  11. package/out/app.txt +2 -2
  12. package/out/blog/go-to-bed-wake-up-to-a-finished-product.html +1 -1
  13. package/out/blog/go-to-bed-wake-up-to-a-finished-product.txt +1 -1
  14. package/out/blog/let-them-cook-multi-agent-orchestration.html +1 -1
  15. package/out/blog/let-them-cook-multi-agent-orchestration.txt +1 -1
  16. package/out/blog.html +1 -1
  17. package/out/blog.txt +1 -1
  18. package/out/careers.html +1 -1
  19. package/out/careers.txt +1 -1
  20. package/out/changelog.html +1 -1
  21. package/out/changelog.txt +1 -1
  22. package/out/cloud/link.html +1 -1
  23. package/out/cloud/link.txt +1 -1
  24. package/out/complete-profile.html +1 -1
  25. package/out/complete-profile.txt +1 -1
  26. package/out/connect-repos.html +1 -1
  27. package/out/connect-repos.txt +1 -1
  28. package/out/contact.html +1 -1
  29. package/out/contact.txt +1 -1
  30. package/out/dev/cli-tools.html +1 -1
  31. package/out/dev/cli-tools.txt +1 -1
  32. package/out/dev/log-viewer.html +1 -1
  33. package/out/dev/log-viewer.txt +1 -1
  34. package/out/docs.html +1 -1
  35. package/out/docs.txt +1 -1
  36. package/out/history.html +1 -1
  37. package/out/history.txt +1 -1
  38. package/out/index.html +1 -1
  39. package/out/index.txt +2 -2
  40. package/out/login.html +1 -1
  41. package/out/login.txt +1 -1
  42. package/out/metrics.html +1 -1
  43. package/out/metrics.txt +1 -1
  44. package/out/pricing.html +1 -1
  45. package/out/pricing.txt +1 -1
  46. package/out/privacy.html +1 -1
  47. package/out/privacy.txt +1 -1
  48. package/out/providers/setup/claude.html +1 -1
  49. package/out/providers/setup/claude.txt +1 -1
  50. package/out/providers/setup/codex.html +1 -1
  51. package/out/providers/setup/codex.txt +1 -1
  52. package/out/providers/setup/cursor.html +1 -1
  53. package/out/providers/setup/cursor.txt +1 -1
  54. package/out/providers.html +1 -1
  55. package/out/providers.txt +1 -1
  56. package/out/security.html +1 -1
  57. package/out/security.txt +1 -1
  58. package/out/signup.html +1 -1
  59. package/out/signup.txt +1 -1
  60. package/out/terms.html +1 -1
  61. package/out/terms.txt +1 -1
  62. package/package.json +3 -3
  63. package/src/providers/RelayConfigProvider.tsx +17 -0
  64. package/src/providers/SendProvider.tsx +38 -4
  65. package/out/_next/static/chunks/3677-4b225baf4801d9b9.js +0 -73
  66. /package/out/_next/static/{49XhcS8k_e8607S7KBMwA → Z91dsVnsvqDCvvYfCXRXH}/_buildManifest.js +0 -0
  67. /package/out/_next/static/{49XhcS8k_e8607S7KBMwA → Z91dsVnsvqDCvvYfCXRXH}/_ssgManifest.js +0 -0
@@ -156,9 +156,18 @@ export function SendProvider({ children, localMessages, localUsername }: SendPro
156
156
  }, [localMessages, selectedChannelId, effectiveActiveWorkspaceId, currentUser?.displayName, relayAgentName]);
157
157
 
158
158
  const effectiveChannelMessages = useMemo(() => {
159
- const sourceMessages = usingRelayChannelMessages
160
- ? relayMappedChannelMessages
161
- : (channelMessages.length > 0 ? channelMessages : localChannelMessages);
159
+ if (usingRelayChannelMessages) {
160
+ // Prefer relay SDK messages; fall back to server-fetched messages when
161
+ // the relay hook returns empty (e.g. agent hasn't joined the channel yet).
162
+ if (relayMappedChannelMessages.length > 0) {
163
+ return sortChannelMessagesChronologically(relayMappedChannelMessages);
164
+ }
165
+ if (channelMessages.length > 0) {
166
+ return sortChannelMessagesChronologically(channelMessages);
167
+ }
168
+ return [];
169
+ }
170
+ const sourceMessages = channelMessages.length > 0 ? channelMessages : localChannelMessages;
162
171
  return sortChannelMessagesChronologically(sourceMessages);
163
172
  }, [usingRelayChannelMessages, relayMappedChannelMessages, channelMessages, localChannelMessages]);
164
173
 
@@ -252,7 +261,12 @@ export function SendProvider({ children, localMessages, localUsername }: SendPro
252
261
  if (isWorkspaceFeaturesEnabled && !effectiveActiveWorkspaceId) return;
253
262
 
254
263
  if (relayConfigured && selectedChannelId.startsWith('#')) {
255
- setChannelMessages(relayMappedChannelMessages);
264
+ // When the relay SDK has messages, use them directly.
265
+ // Otherwise, keep any server-fetched messages we already have — do NOT
266
+ // overwrite them with the empty relay array on every re-render.
267
+ if (relayMappedChannelMessages.length > 0) {
268
+ setChannelMessages(relayMappedChannelMessages);
269
+ }
256
270
  setHasMoreMessages(false);
257
271
  setChannelUnreadState(undefined);
258
272
  setChannelsList(prev =>
@@ -260,6 +274,26 @@ export function SendProvider({ children, localMessages, localUsername }: SendPro
260
274
  c.id === selectedChannelId ? { ...c, unreadCount: 0, hasMentions: false } : c
261
275
  )
262
276
  );
277
+
278
+ // Fallback: when the relay SDK hook returns empty (e.g. dashboard agent
279
+ // hasn't joined the channel), fetch from the server API which uses the
280
+ // workspace API key and has full read access to all channels.
281
+ if (relayMappedChannelMessages.length === 0 && !relayMessagesState.loading && !fetchedChannelsRef.current.has(selectedChannelId)) {
282
+ const channelToFetch = selectedChannelId;
283
+ fetchedChannelsRef.current.add(channelToFetch);
284
+ (async () => {
285
+ try {
286
+ const { getMessages } = await import('../components/channels');
287
+ const response = await getMessages(effectiveActiveWorkspaceId || 'local', channelToFetch, { limit: 200 });
288
+ const sortedMessages = sortChannelMessagesChronologically(response.messages);
289
+ setChannelMessageMap(prev => ({ ...prev, [channelToFetch]: sortedMessages }));
290
+ setChannelMessages(sortedMessages);
291
+ } catch (err) {
292
+ console.error('Failed to fetch channel messages fallback:', err);
293
+ fetchedChannelsRef.current.delete(channelToFetch);
294
+ }
295
+ })();
296
+ }
263
297
  return;
264
298
  }
265
299