Source-only publication of reviewed commit 64e96a7f423673dc29ad56485be9fc79bce8af1c.
Passed in isolation: focused frontend/backend tests, race checks, TypeScript typecheck, lint, Go compilation, Flowgram build, and deterministic SDK build/tests.
Not accepted as a production release: Next.js export/native assembly remains blocked by environment memory limits; browser interaction and MySQL staging acceptance remain unverified. No production server, database/schema, runtime configuration, deployment, release tag, or workflow execution was performed.
Expected source tree: 0a4a7528e9.
40 lines
1.5 KiB
JavaScript
40 lines
1.5 KiB
JavaScript
// Modified by the independent AgentDesk fork for support reliability and availability.
|
|
import assert from "node:assert/strict";
|
|
import { readFile } from "node:fs/promises";
|
|
|
|
import { describe, it } from "node:test";
|
|
|
|
const providerSource = await readFile(
|
|
new URL("./agent-realtime-provider.tsx", import.meta.url),
|
|
"utf8",
|
|
).catch(() => "");
|
|
const workbenchLayoutSource = await readFile(
|
|
new URL("../app/(dashboard)/workbench/layout.tsx", import.meta.url),
|
|
"utf8",
|
|
);
|
|
const dashboardConversationsPageSource = await readFile(
|
|
new URL("../app/(dashboard)/dashboard/conversations/page.tsx", import.meta.url),
|
|
"utf8",
|
|
);
|
|
const conversationWorkbenchSource = await readFile(
|
|
new URL("../app/(dashboard)/dashboard/conversations/_components/conversation-workbench.tsx", import.meta.url),
|
|
"utf8",
|
|
);
|
|
|
|
describe("AgentRealtimeProvider placement", () => {
|
|
it("owns the agent realtime hook", () => {
|
|
assert.match(providerSource, /export function AgentRealtimeProvider/);
|
|
assert.match(providerSource, /useAgentConversationRealtime\(\)/);
|
|
});
|
|
|
|
it("is mounted at the workbench layout level", () => {
|
|
assert.match(workbenchLayoutSource, /import \{ AgentRealtimeProvider \}/);
|
|
assert.match(workbenchLayoutSource, /<AgentRealtimeProvider \/>/);
|
|
});
|
|
|
|
it("keeps dashboard conversations realtime without tying it to ConversationWorkbench", () => {
|
|
assert.match(dashboardConversationsPageSource, /<AgentRealtimeProvider \/>/);
|
|
assert.doesNotMatch(conversationWorkbenchSource, /useAgentConversationRealtime/);
|
|
});
|
|
});
|