@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.
- package/out/404.html +1 -1
- package/out/_next/static/chunks/{1028-53c5a7e2453505f8.js → 1028-85d028e818d3ef30.js} +1 -1
- package/out/_next/static/chunks/3238-24c1e4b1cefe3c71.js +73 -0
- package/out/_next/static/chunks/app/app/[[...slug]]/{page-3dffd65b6344f53e.js → page-f33c6214e21ccfdd.js} +1 -1
- package/out/_next/static/chunks/app/{page-09ce10603ad9a251.js → page-2e38080856c3c293.js} +1 -1
- package/out/about.html +1 -1
- package/out/about.txt +1 -1
- package/out/app/onboarding.html +1 -1
- package/out/app/onboarding.txt +1 -1
- package/out/app.html +1 -1
- package/out/app.txt +2 -2
- package/out/blog/go-to-bed-wake-up-to-a-finished-product.html +1 -1
- package/out/blog/go-to-bed-wake-up-to-a-finished-product.txt +1 -1
- package/out/blog/let-them-cook-multi-agent-orchestration.html +1 -1
- package/out/blog/let-them-cook-multi-agent-orchestration.txt +1 -1
- package/out/blog.html +1 -1
- package/out/blog.txt +1 -1
- package/out/careers.html +1 -1
- package/out/careers.txt +1 -1
- package/out/changelog.html +1 -1
- package/out/changelog.txt +1 -1
- package/out/cloud/link.html +1 -1
- package/out/cloud/link.txt +1 -1
- package/out/complete-profile.html +1 -1
- package/out/complete-profile.txt +1 -1
- package/out/connect-repos.html +1 -1
- package/out/connect-repos.txt +1 -1
- package/out/contact.html +1 -1
- package/out/contact.txt +1 -1
- package/out/dev/cli-tools.html +1 -1
- package/out/dev/cli-tools.txt +1 -1
- package/out/dev/log-viewer.html +1 -1
- package/out/dev/log-viewer.txt +1 -1
- package/out/docs.html +1 -1
- package/out/docs.txt +1 -1
- package/out/history.html +1 -1
- package/out/history.txt +1 -1
- package/out/index.html +1 -1
- package/out/index.txt +2 -2
- package/out/login.html +1 -1
- package/out/login.txt +1 -1
- package/out/metrics.html +1 -1
- package/out/metrics.txt +1 -1
- package/out/pricing.html +1 -1
- package/out/pricing.txt +1 -1
- package/out/privacy.html +1 -1
- package/out/privacy.txt +1 -1
- package/out/providers/setup/claude.html +1 -1
- package/out/providers/setup/claude.txt +1 -1
- package/out/providers/setup/codex.html +1 -1
- package/out/providers/setup/codex.txt +1 -1
- package/out/providers/setup/cursor.html +1 -1
- package/out/providers/setup/cursor.txt +1 -1
- package/out/providers.html +1 -1
- package/out/providers.txt +1 -1
- package/out/security.html +1 -1
- package/out/security.txt +1 -1
- package/out/signup.html +1 -1
- package/out/signup.txt +1 -1
- package/out/terms.html +1 -1
- package/out/terms.txt +1 -1
- package/package.json +3 -3
- package/src/providers/RelayConfigProvider.tsx +17 -0
- package/src/providers/SendProvider.tsx +38 -4
- package/out/_next/static/chunks/3677-4b225baf4801d9b9.js +0 -73
- /package/out/_next/static/{49XhcS8k_e8607S7KBMwA → Z91dsVnsvqDCvvYfCXRXH}/_buildManifest.js +0 -0
- /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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
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
|
|