Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.
Python agent-orchestrationaiai-agentschatopsdiscordlangchainmcpmicrosoft-teamsmulti-agentopen-sourceopenaiself-hostedslack
Resources: call the library what the gateway calls it, and say where room documents are
Simon Flackca0e22a20b35
diff --git a/console/apps/switch-console-desktop/src/renderer/features/library/library-item-view.tsx b/console/apps/switch-console-desktop/src/renderer/features/library/library-item-view.tsxindex a14318cb7..fb487f979 100644--- a/console/apps/switch-console-desktop/src/renderer/features/library/library-item-view.tsx+++ b/console/apps/switch-console-desktop/src/renderer/features/library/library-item-view.tsx@@ -83,7 +83,7 @@ const LibraryItemTitlebar = observer(function LibraryItemTitlebar() {<ServerSectionTitlebarserverId={serverId}icon={Library}- label="Library"+ label="Resources"onSectionClick={() => navigate('library', { serverId, kind })}item={{ label: item.data?.name ?? KIND_TEXT[kind].Noun }}/>@@ -129,7 +129,7 @@ const LibraryItemPanel = observer(function LibraryItemPanel() {<PageHeader sticky title={text.Noun} back={back} /><p className="text-sm text-destructive">{workspaceId === null- ? 'This server has no workspace yet, so its library cannot be read.'+ ? 'This server has no workspace yet, so its resources cannot be read.': failureText(item.error, `Could not read this ${text.noun}.`)}</p></Page>diff --git a/console/apps/switch-console-desktop/src/renderer/features/library/library-modals.tsx b/console/apps/switch-console-desktop/src/renderer/features/library/library-modals.tsxindex 0487da268..7f2fac49b 100644--- a/console/apps/switch-console-desktop/src/renderer/features/library/library-modals.tsx+++ b/console/apps/switch-console-desktop/src/renderer/features/library/library-modals.tsx@@ -46,7 +46,7 @@ export function NewLibraryItemModal({ workspaceId, kind, onSuccess, onClose }: Ninput: inputOf(kind, form),});await invalidateLibrary(queryClient, workspaceId, kind);- toast({ title: `"${created.name}" added to the library` });+ toast({ title: `"${created.name}" added to Resources` });onSuccess(created);} catch (e) {setError(failureText(e, `Could not add the ${text.noun}.`));diff --git a/console/apps/switch-console-desktop/src/renderer/features/library/library-view.tsx b/console/apps/switch-console-desktop/src/renderer/features/library/library-view.tsxindex 463e8b184..b2c4b6fee 100644--- a/console/apps/switch-console-desktop/src/renderer/features/library/library-view.tsx+++ b/console/apps/switch-console-desktop/src/renderer/features/library/library-view.tsx@@ -34,7 +34,7 @@ function useViewParams() {const LibraryTitlebar = observer(function LibraryTitlebar() {return (- <ServerSectionTitlebar serverId={useViewParams().serverId} icon={Library} label="Library" />+ <ServerSectionTitlebar serverId={useViewParams().serverId} icon={Library} label="Resources" />);});@@ -49,7 +49,8 @@ const SCOPES = [] as const;/**- * The workspace's library: the references and documents anyone may attach to+ * The workspace's resources (the gateway's word; "library" in the code): the+ * references and documents anyone may attach to* a room, as cards. Each opens a page to change it, see the rooms it is in and* attach it to more.*/@@ -92,7 +93,7 @@ const LibraryPanel = observer(function LibraryPanel() {return (<ServerPagewidth={LIST_PAGE_WIDTH}- title="Library"+ title="Resources"description="References and documents your agents can be given. Attach them to a room and every agent there can use them."action={<Button size="sm" disabled={workspaceId === null} onClick={create}>@@ -103,7 +104,7 @@ const LibraryPanel = observer(function LibraryPanel() {>{workspaceId === null ? (<ServerTableEmpty>- This server has no workspace yet, so its library cannot be read.+ This server has no workspace yet, so its resources cannot be read.</ServerTableEmpty>) : (<div className="flex flex-col gap-4">@@ -114,6 +115,14 @@ const LibraryPanel = observer(function LibraryPanel() {options={KINDS}className="w-max"/>+ {kind === 'documents' && (+ // The server keeps an agent's room documents out of this list, which+ // surprises someone who knows one exists: say where it is.+ <p className="text-xs text-foreground-muted">+ Documents an agent writes in a room belong to that room, so they aren’t listed here.+ Find them in the room’s Resources tab.+ </p>+ )}<ListToolbarscope={viewer.id !== null && (diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav.tsx b/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav.tsxindex 640eb15a8..4487ab990 100644--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav.tsx+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav.tsx@@ -58,7 +58,7 @@ export const WorkspaceNav = observer(function WorkspaceNav() {server: { icon: House, label: 'Home', params: homeParams },serverAgents: { icon: Bot, label: 'Your Agents', params: agentsParams },serverRooms: { icon: DoorOpen, label: 'Rooms', params: roomsParams },- library: { icon: Library, label: 'Library', params: libraryParams },+ library: { icon: Library, label: 'Resources', params: libraryParams },templates: { icon: FileText, label: 'Templates', params: templatesParams },connectors: { icon: Plug, label: 'Connectors', params: connectorsParams },admin: { icon: ShieldCheck, label: 'Admin', params: adminParams },diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-rooms/room-resources-panel.tsx b/console/apps/switch-console-desktop/src/renderer/features/switch-rooms/room-resources-panel.tsxindex 5f3dfe96e..4ad06d87b 100644--- a/console/apps/switch-console-desktop/src/renderer/features/switch-rooms/room-resources-panel.tsx+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-rooms/room-resources-panel.tsx@@ -335,8 +335,8 @@ function ResourceRow({<Buttonvariant="ghost"size="icon-xs"- aria-label={`Show ${resource.name} in the Library`}- title="Show in the Library"+ aria-label={`Show ${resource.name} in Resources`}+ title="Show in Resources"onClick={onShowInLibrary}><Library />diff --git a/console/apps/switch-console-desktop/src/renderer/tests/browser/library-view.test.tsx b/console/apps/switch-console-desktop/src/renderer/tests/browser/library-view.test.tsxindex 8230fd809..59fa40495 100644--- a/console/apps/switch-console-desktop/src/renderer/tests/browser/library-view.test.tsx+++ b/console/apps/switch-console-desktop/src/renderer/tests/browser/library-view.test.tsx@@ -233,6 +233,19 @@ describe('the Library page', () => {);});+ it('says where an agent’s room documents are, since they are not listed here', async () => {+ await render(libraryView.MainPanel);+ expect(container.textContent).not.toContain('belong to that room');+ await act(async () => button('Documents')!.click());+ await settle();+ expect(container.textContent).toContain('Find them in the room’s Resources tab.');+ });++ it('calls the page Resources, as the gateway does', async () => {+ await render(libraryView.MainPanel);+ expect(container.querySelector('h1, h2')?.textContent).toBe('Resources');+ });+it('says so when there is nothing yet', async () => {state.items.references = [];await render(libraryView.MainPanel);diff --git a/console/apps/switch-console-desktop/src/renderer/tests/browser/room-resources-panel.test.tsx b/console/apps/switch-console-desktop/src/renderer/tests/browser/room-resources-panel.test.tsxindex 1d74dfbd1..3fea355f4 100644--- a/console/apps/switch-console-desktop/src/renderer/tests/browser/room-resources-panel.test.tsx+++ b/console/apps/switch-console-desktop/src/renderer/tests/browser/room-resources-panel.test.tsx@@ -233,15 +233,15 @@ describe('the Resources tab', () => {it('opens a reference or document from the library on its Library page, not a room-only one', async () => {const el = await renderPanel();await act(async () =>- el.querySelector<HTMLButtonElement>('[aria-label="Show Guide in the Library"]')!.click()+ el.querySelector<HTMLButtonElement>('[aria-label="Show Guide in Resources"]')!.click());expect(navigate).toHaveBeenCalledWith('libraryItem', {serverId: 'srv-1',kind: 'documents',itemId: 'd-1',});- expect(el.querySelector('[aria-label="Show Repo in the Library"]')).not.toBeNull();- expect(el.querySelector('[aria-label="Show Standup notes in the Library"]')).toBeNull();- expect(el.querySelector('[aria-label="Show Onboarding in the Library"]')).toBeNull();+ expect(el.querySelector('[aria-label="Show Repo in Resources"]')).not.toBeNull();+ expect(el.querySelector('[aria-label="Show Standup notes in Resources"]')).toBeNull();+ expect(el.querySelector('[aria-label="Show Onboarding in Resources"]')).toBeNull();});});