Skip to content

The open-source agent harness - the runtime layer that turns an LLM into a working agent.

feat: Add Register Skills slot action to Skills modal header (#887)

harshil-20965da156acec4f
diff --git a/.changeset/skills-header-register-slot.md b/.changeset/skills-header-register-slot.md
new file mode 100644
index 000000000..fa8e11ad9
--- /dev/null
+++ b/.changeset/skills-header-register-slot.md
@@ -0,0 +1,6 @@
+---
+'@truefoundry/trueforge-ui': patch
+'@truefoundry/trueforge': patch
+---
+
+Add a host-overridable Register Skills action next to the Skills modal title. The default slot waits for capabilities, routes to Settings → Skills or a platform URL, and hides when neither applies.
diff --git a/packages/frontend/src/App.tsx b/packages/frontend/src/App.tsx
index 65e7c7b70..91ee09705 100644
--- a/packages/frontend/src/App.tsx
+++ b/packages/frontend/src/App.tsx
@@ -24,6 +24,7 @@ import { GetStartedScreen } from './GetStartedScreen';
import { LogoutButton } from './LogoutButton';
import { NewAgentWelcomeScreen } from './NewAgentWelcomeScreen';
import { API_BASE_URL, uiRouterBasename } from './publicPath';
+import { RegisterSkillsLink } from './RegisterSkillsLink';
const POSTHOG_API_KEY = import.meta.env.VITE_POSTHOG_API_KEY;
const POSTHOG_HOST = import.meta.env.VITE_POSTHOG_HOST ?? 'https://us.i.posthog.com';
@@ -171,7 +172,11 @@ export function App() {
}, [session]);
const overrides: SlotOverrides = useMemo(
- () => ({ ShellActionsActionSlot: LogoutButton, WelcomeScreen: NewAgentWelcomeScreen }),
+ () => ({
+ ShellActionsActionSlot: LogoutButton,
+ WelcomeScreen: NewAgentWelcomeScreen,
+ AgentSkillsHeaderActionSlot: RegisterSkillsLink,
+ }),
[],
);
diff --git a/packages/frontend/src/RegisterSkillsLink.tsx b/packages/frontend/src/RegisterSkillsLink.tsx
new file mode 100644
index 000000000..89e102d76
--- /dev/null
+++ b/packages/frontend/src/RegisterSkillsLink.tsx
@@ -0,0 +1,20 @@
+import { AgentSkillsHeaderActionSlot, DEFAULT_PLATFORM_SKILLS_URL } from '@truefoundry/trueforge-ui';
+
+import { apiPath } from './publicPath';
+
+/** Host override for `AgentSkillsHeaderActionSlot`. */
+export function RegisterSkillsLink(
+ props: {
+ /** Site-root platform registry (not under TrueForge PUBLIC_BASE_URL). */
+ platformSkillsUrl?: string;
+ /** TrueForge settings path including PUBLIC_BASE_URL prefix. */
+ settingsSkillsUrl?: string;
+ } = {},
+) {
+ return (
+ <AgentSkillsHeaderActionSlot
+ platformSkillsUrl={props.platformSkillsUrl ?? DEFAULT_PLATFORM_SKILLS_URL}
+ settingsSkillsUrl={props.settingsSkillsUrl ?? apiPath('/settings')}
+ />
+ );
+}
diff --git a/packages/trueforge-ui/src/atoms/draft/AgentResourceConfigModal.tsx b/packages/trueforge-ui/src/atoms/draft/AgentResourceConfigModal.tsx
index 687b7b0be..3a396dc5e 100644
--- a/packages/trueforge-ui/src/atoms/draft/AgentResourceConfigModal.tsx
+++ b/packages/trueforge-ui/src/atoms/draft/AgentResourceConfigModal.tsx
@@ -30,6 +30,7 @@ export type AgentResourceConfigModalProps = {
export function AgentResourceConfigModal({ editor, onClose, ...contentProps }: AgentResourceConfigModalProps) {
const AgentResourceEditorContent = useSlot('AgentResourceEditorContent');
+ const AgentSkillsHeaderActionSlot = useSlot('AgentSkillsHeaderActionSlot');
const selectingMcp = editor === 'mcp';
return (
@@ -37,6 +38,7 @@ export function AgentResourceConfigModal({ editor, onClose, ...contentProps }: A
open={editor !== null}
onOpenChange={open => !open && onClose()}
title={selectingMcp ? 'Select MCP Tools' : 'Skills'}
+ titleAccessory={selectingMcp ? undefined : <AgentSkillsHeaderActionSlot />}
className={
selectingMcp
? 'md:w-[min(64rem,calc(100%-3rem))] md:max-w-5xl'
diff --git a/packages/trueforge-ui/src/atoms/draft/AgentSkillsHeaderActionSlot.tsx b/packages/trueforge-ui/src/atoms/draft/AgentSkillsHeaderActionSlot.tsx
new file mode 100644
index 000000000..78e8f6475
--- /dev/null
+++ b/packages/trueforge-ui/src/atoms/draft/AgentSkillsHeaderActionSlot.tsx
@@ -0,0 +1,98 @@
+'use client';
+
+import { Icon } from '../../icons/Icon.js';
+import { useOptionalResolvedRoutes } from '../../routing/ResolvedRoutesContext.js';
+import {
+ useOptionalCatalogServer,
+ useServerCapabilities,
+ useServerCapabilitiesSettled,
+} from '../../server/ServerContext.js';
+import { useOptionalShellMode } from '../../server/ShellModeContext.js';
+import { isSettingsChromeEnabled } from '../../server/serverChrome.js';
+import { Button } from '../primitives/Button.js';
+import { resolveSettingsSkillsUrl } from './resolveSkillsNavigationUrls.js';
+import { DEFAULT_PLATFORM_SKILLS_URL, DEFAULT_SETTINGS_SKILLS_URL } from './skillsNavigationDefaults.js';
+
+export { DEFAULT_PLATFORM_SKILLS_URL, DEFAULT_SETTINGS_SKILLS_URL } from './skillsNavigationDefaults.js';
+
+export type AgentSkillsHeaderActionSlotProps = {
+ /**
+ * External skills registry at the **site origin**.
+ * Not prefixed with TrueForge `routes.basename`. Pass `""` to omit.
+ */
+ platformSkillsUrl?: string;
+ /** Settings fallback when shell context is missing; default is basename-aware via router. */
+ settingsSkillsUrl?: string;
+};
+
+function canRegisterViaSettings({
+ catalog,
+ capabilities,
+}: {
+ catalog: ReturnType<typeof useOptionalCatalogServer>;
+ capabilities: ReturnType<typeof useServerCapabilities>;
+}): boolean {
+ return isSettingsChromeEnabled({ catalog, capabilities }) && catalog?.skillCatalog != null;
+}
+
+function hasPlatformSkillsDestination(platformSkillsUrl: string): boolean {
+ return platformSkillsUrl.length > 0;
+}
+
+/**
+ * Host chrome to the right of the Skills modal title. Waits for capabilities
+ * before rendering; hides when neither settings skills nor a platform URL apply.
+ */
+export function AgentSkillsHeaderActionSlot({
+ platformSkillsUrl = DEFAULT_PLATFORM_SKILLS_URL,
+ settingsSkillsUrl = DEFAULT_SETTINGS_SKILLS_URL,
+}: AgentSkillsHeaderActionSlotProps = {}) {
+ const catalog = useOptionalCatalogServer();
+ const capabilities = useServerCapabilities();
+ const capabilitiesSettled = useServerCapabilitiesSettled();
+ const shell = useOptionalShellMode();
+ const routes = useOptionalResolvedRoutes();
+ const settingsHref = resolveSettingsSkillsUrl({ settingsSkillsUrl, routes });
+
+ if (!capabilitiesSettled) {
+ return null;
+ }
+
+ const registerViaSettings = canRegisterViaSettings({ catalog, capabilities });
+ const registerViaPlatform = hasPlatformSkillsDestination(platformSkillsUrl);
+
+ if (!registerViaSettings && !registerViaPlatform) {
+ return null;
+ }
+
+ return (
+ <Button.Ghost
+ type="button"
+ size="small"
+ className="ml-1 shrink-0"
+ title="Register Skills"
+ onClick={() => {
+ if (canRegisterViaSettings({ catalog, capabilities })) {
+ if (shell != null) {
+ shell.setSettingsOpen(true, 'skills');
+ return;
+ }
+ window.location.assign(settingsHref);
+ return;
+ }
+ if (hasPlatformSkillsDestination(platformSkillsUrl)) {
+ window.location.assign(platformSkillsUrl);
+ }
+ }}
+ >
+ Register Skills
+ <Icon name="external-link" className="size-3 shrink-0" />
+ </Button.Ghost>
+ );
+}
+
+declare module '../../theme/SlotsProvider.js' {
+ interface AtomSlots {
+ AgentSkillsHeaderActionSlot: typeof AgentSkillsHeaderActionSlot;
+ }
+}
diff --git a/packages/trueforge-ui/src/atoms/draft/resolveSkillsNavigationUrls.ts b/packages/trueforge-ui/src/atoms/draft/resolveSkillsNavigationUrls.ts
new file mode 100644
index 000000000..c0999a235
--- /dev/null
+++ b/packages/trueforge-ui/src/atoms/draft/resolveSkillsNavigationUrls.ts
@@ -0,0 +1,22 @@
+import { buildPath } from '../../routing/paths.js';
+import type { ResolvedRoutes } from '../../routing/types.js';
+import { DEFAULT_SETTINGS_SKILLS_URL } from './skillsNavigationDefaults.js';
+
+/** Settings fallback path including router `basename` when the host still uses SDK defaults. */
+export function resolveSettingsSkillsUrl({
+ settingsSkillsUrl,
+ routes,
+}: {
+ settingsSkillsUrl: string;
+ routes: ResolvedRoutes | null;
+}): string {
+ if (settingsSkillsUrl !== DEFAULT_SETTINGS_SKILLS_URL || routes == null) {
+ return settingsSkillsUrl;
+ }
+ const settingsPath = buildPath({ type: 'settings' }, routes);
+ if (settingsPath == null) {
+ return settingsSkillsUrl;
+ }
+ const basename = routes.basename.endsWith('/') ? routes.basename.slice(0, -1) : routes.basename;
+ return `${basename}${settingsPath}` || settingsPath;
+}
diff --git a/packages/trueforge-ui/src/atoms/draft/skillsNavigationDefaults.ts b/packages/trueforge-ui/src/atoms/draft/skillsNavigationDefaults.ts
new file mode 100644
index 000000000..aa7400d70
--- /dev/null
+++ b/packages/trueforge-ui/src/atoms/draft/skillsNavigationDefaults.ts
@@ -0,0 +1,5 @@
+/** TrueFoundry platform skills registry (site root, not TrueForge UI basename). */
+export const DEFAULT_PLATFORM_SKILLS_URL = '/skills';
+
+/** Settings route segment before basename is applied. */
+export const DEFAULT_SETTINGS_SKILLS_URL = '/settings';
diff --git a/packages/trueforge-ui/src/atoms/primitives/CenteredModal.tsx b/packages/trueforge-ui/src/atoms/primitives/CenteredModal.tsx
index 2fee462c8..97cb9ec84 100644
--- a/packages/trueforge-ui/src/atoms/primitives/CenteredModal.tsx
+++ b/packages/trueforge-ui/src/atoms/primitives/CenteredModal.tsx
@@ -13,6 +13,8 @@ export type CenteredModalProps = {
onOpenChange: (open: boolean) => void;
title: string;
description?: string;
+ /** Rendered immediately to the right of the title (e.g. a host action link). */
+ titleAccessory?: ReactNode;
headerIcon?: ReactNode;
children: ReactNode;
footer?: ReactNode;
@@ -30,6 +32,7 @@ export function CenteredModal({
onOpenChange,
title,
description,
+ titleAccessory,
headerIcon,
children,
footer,
@@ -92,9 +95,12 @@ export function CenteredModal({
<header className="bg-topbar-bg flex shrink-0 items-center gap-3 border-b border-border px-5 py-4">
{headerIcon}
<div className="min-w-0 flex-1">
- <h2 id={titleId} className="text-text-primary text-lg font-semibold tracking-tight">
- {title}
- </h2>
+ <div className="flex min-w-0 items-center justify-between gap-2">
+ <h2 id={titleId} className="text-text-primary truncate text-lg font-semibold tracking-tight">
+ {title}
+ </h2>
+ {titleAccessory}
+ </div>
{description ? (
<p id={descriptionId} className="text-text-secondary mt-1 text-sm">
{description}
diff --git a/packages/trueforge-ui/src/index.ts b/packages/trueforge-ui/src/index.ts
index c0b6f86c4..24f2a7917 100644
--- a/packages/trueforge-ui/src/index.ts
+++ b/packages/trueforge-ui/src/index.ts
@@ -536,6 +536,12 @@ export { AgentRuntimeEditorContent } from './atoms/draft/AgentRuntimeEditorConte
export type { AgentRuntimeEditorContentProps } from './atoms/draft/AgentRuntimeEditorContent.js';
export { AgentSkillsEditorContent } from './atoms/draft/AgentSkillsEditorContent.js';
export type { AgentSkillsEditorContentProps } from './atoms/draft/AgentSkillsEditorContent.js';
+export {
+ AgentSkillsHeaderActionSlot,
+ DEFAULT_PLATFORM_SKILLS_URL,
+ DEFAULT_SETTINGS_SKILLS_URL,
+} from './atoms/draft/AgentSkillsHeaderActionSlot.js';
+export type { AgentSkillsHeaderActionSlotProps } from './atoms/draft/AgentSkillsHeaderActionSlot.js';
export { DraftAgentConfigTrigger } from './atoms/draft/DraftAgentConfigTrigger.js';
export type { DraftAgentConfigTriggerProps } from './atoms/draft/DraftAgentConfigTrigger.js';
export { DraftCapabilitiesPanel } from './atoms/draft/DraftCapabilitiesPanel.js';
diff --git a/packages/trueforge-ui/src/theme/defaultSlots.ts b/packages/trueforge-ui/src/theme/defaultSlots.ts
index a627cf7ed..f99a2ba03 100644
--- a/packages/trueforge-ui/src/theme/defaultSlots.ts
+++ b/packages/trueforge-ui/src/theme/defaultSlots.ts
@@ -56,6 +56,7 @@ import { AgentRuntimeConfigDrawer } from '../atoms/draft/AgentRuntimeConfigDrawe
import { AgentRuntimeConfigFields } from '../atoms/draft/AgentRuntimeConfigFields.js';
import { AgentRuntimeEditorContent } from '../atoms/draft/AgentRuntimeEditorContent.js';
import { AgentSkillsEditorContent } from '../atoms/draft/AgentSkillsEditorContent.js';
+import { AgentSkillsHeaderActionSlot } from '../atoms/draft/AgentSkillsHeaderActionSlot.js';
import { DraftAgentConfigTrigger } from '../atoms/draft/DraftAgentConfigTrigger.js';
import { DraftCapabilitiesPanel } from '../atoms/draft/DraftCapabilitiesPanel.js';
import { DraftComposerActionsMenu } from '../atoms/draft/DraftComposerActionsMenu.js';
@@ -176,6 +177,7 @@ export const defaultSlots = {
AgentResourceEditorContent,
AgentResourceConfigModal,
AgentSkillsEditorContent,
+ AgentSkillsHeaderActionSlot,
AgentConfigPanel,
AgentConfigSection,
AgentRuntimeConfigFields,
diff --git a/packages/trueforge-ui/test/atoms/draft/AgentResourceConfigModal.test.tsx b/packages/trueforge-ui/test/atoms/draft/AgentResourceConfigModal.test.tsx
new file mode 100644
index 000000000..ba14cdcde
--- /dev/null
+++ b/packages/trueforge-ui/test/atoms/draft/AgentResourceConfigModal.test.tsx
@@ -0,0 +1,99 @@
+// @vitest-environment jsdom
+import { render, screen } from '@testing-library/react';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+
+import { AgentResourceConfigModal } from '@/atoms/draft/AgentResourceConfigModal.js';
+import type { AgentSpec } from '@/server/types.js';
+import { SlotsProvider } from '@/theme/SlotsProvider.js';
+
+const originalShowModal = Object.getOwnPropertyDescriptor(HTMLDialogElement.prototype, 'showModal');
+const originalClose = Object.getOwnPropertyDescriptor(HTMLDialogElement.prototype, 'close');
+const showModal = vi.fn(function showModal(this: HTMLDialogElement) {
+ this.open = true;
+});
+const close = vi.fn(function close(this: HTMLDialogElement) {
+ this.open = false;
+ this.dispatchEvent(new Event('close'));
+});
+
+beforeEach(() => {
+ showModal.mockClear();
+ close.mockClear();
+ Object.defineProperty(HTMLDialogElement.prototype, 'showModal', {
+ configurable: true,
+ value: showModal,
+ });
+ Object.defineProperty(HTMLDialogElement.prototype, 'close', {
+ configurable: true,
+ value: close,
+ });
+});
+
+afterEach(() => {
+ if (originalShowModal === undefined) {
+ Reflect.deleteProperty(HTMLDialogElement.prototype, 'showModal');
+ } else {
+ Object.defineProperty(HTMLDialogElement.prototype, 'showModal', originalShowModal);
+ }
+ if (originalClose === undefined) {
+ Reflect.deleteProperty(HTMLDialogElement.prototype, 'close');
+ } else {
+ Object.defineProperty(HTMLDialogElement.prototype, 'close', originalClose);
+ }
+});
+
+const emptySpec: AgentSpec = { model: { name: 'openai/gpt' } };
+
+const baseProps = {
+ spec: emptySpec,
+ connectors: [],
+ skills: [],
+ skillsDisabled: false,
+ query: '',
+ activeConnectorId: null,
+ tools: [],
+ connectorLoading: false,
+ connectorError: null,
+ toolsLoading: false,
+ toolsError: null,
+ onQueryChange: () => undefined,
+ onSelectConnector: () => undefined,
+ onRetryTools: () => undefined,
+ onChange: () => undefined,
+ onClose: () => undefined,
+};
+
+describe('AgentResourceConfigModal', () => {
+ it('renders AgentSkillsHeaderActionSlot next to the Skills title', () => {
+ render(
+ <SlotsProvider
+ overrides={{
+ AgentSkillsHeaderActionSlot: () => <a href="/skills">Register Skills</a>,
+ AgentResourceEditorContent: () => <div>skills body</div>,
+ }}
+ >
+ <AgentResourceConfigModal editor="skills" {...baseProps} />
+ </SlotsProvider>,
+ );
+
+ const title = screen.getByRole('heading', { name: 'Skills' });
+ const accessory = screen.getByRole('link', { name: 'Register Skills' });
+ expect(title.nextElementSibling).toBe(accessory);
+ });
+
+ it('does not render the skills header slot for the MCP editor', () => {
+ render(
+ <SlotsProvider
+ overrides={{
+ AgentSkillsHeaderActionSlot: () => <a href="/skills">Register Skills</a>,
+ AgentResourceEditorContent: () => <div>mcp body</div>,
+ }}
+ >
+ <AgentResourceConfigModal editor="mcp" {...baseProps} />
+ </SlotsProvider>,
+ );
+
+ expect(screen.getByRole('heading', { name: 'Select MCP Tools' })).toBeInTheDocument();
+ expect(screen.queryByRole('link', { name: 'Register Skills' })).not.toBeInTheDocument();
+ });
+});
diff --git a/packages/trueforge-ui/test/atoms/draft/AgentSkillsHeaderActionSlot.test.tsx b/packages/trueforge-ui/test/atoms/draft/AgentSkillsHeaderActionSlot.test.tsx
new file mode 100644
index 000000000..3d89ebe55
--- /dev/null
+++ b/packages/trueforge-ui/test/atoms/draft/AgentSkillsHeaderActionSlot.test.tsx
@@ -0,0 +1,117 @@
+// @vitest-environment jsdom
+import { fireEvent, render, screen } from '@testing-library/react';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+import { AgentSkillsHeaderActionSlot } from '@/atoms/draft/AgentSkillsHeaderActionSlot.js';
+import type { CatalogServer } from '@/server/types.js';
+import { createMockCatalog } from '../../server/mockServer.js';
+
+const setSettingsOpen = vi.fn();
+
+vi.mock('@/server/ShellModeContext.js', () => ({
+ useOptionalShellMode: () => ({ setSettingsOpen }),
+}));
+
+const useServerCapabilities = vi.fn();
+const useOptionalCatalogServer = vi.fn();
+const useServerCapabilitiesSettled = vi.fn();
+const useOptionalResolvedRoutes = vi.fn();
+
+vi.mock('@/server/ServerContext.js', async importOriginal => {
+ const actual = await importOriginal<typeof import('@/server/ServerContext.js')>();
+ return {
+ ...actual,
+ useServerCapabilities: () => useServerCapabilities(),
+ useOptionalCatalogServer: () => useOptionalCatalogServer(),
+ useServerCapabilitiesSettled: () => useServerCapabilitiesSettled(),
+ };
+});
+
+vi.mock('@/routing/ResolvedRoutesContext.js', () => ({
+ useOptionalResolvedRoutes: () => useOptionalResolvedRoutes(),
+}));
+
+async function unavailable(): Promise<never> {
+ throw new Error('Unexpected settings catalog call');
+}
+
+const settingsCatalog = createMockCatalog({
+ skillCatalog: {
+ getSkillCatalog: async () => [],
+ listSkills: async () => [],
+ createSkill: unavailable,
+ },
+});
+
+describe('AgentSkillsHeaderActionSlot', () => {
+ const assign = vi.fn();
+
+ beforeEach(() => {
+ setSettingsOpen.mockClear();
+ assign.mockClear();
+ useServerCapabilitiesSettled.mockReturnValue(true);
+ useServerCapabilities.mockReturnValue({
+ sandbox: { enabled: true },
+ skill: { enabled: true },
+ settings: { enabled: true },
+ });
+ useOptionalCatalogServer.mockReturnValue(settingsCatalog);
+ useOptionalResolvedRoutes.mockReturnValue(null);
+ Object.defineProperty(window, 'location', {
+ configurable: true,
+ value: { ...window.location, assign },
+ });
+ });
+
+ it('renders nothing until capabilities are settled', () => {
+ useServerCapabilitiesSettled.mockReturnValue(false);
+
+ render(<AgentSkillsHeaderActionSlot platformSkillsUrl="/platform-skills" />);
+
+ expect(screen.queryByRole('button', { name: 'Register Skills' })).not.toBeInTheDocument();
+ });
+
+ it('opens settings skills when settings chrome and skill catalog are available', () => {
+ render(<AgentSkillsHeaderActionSlot platformSkillsUrl="/platform-skills" />);
+
+ fireEvent.click(screen.getByRole('button', { name: 'Register Skills' }));
+ expect(setSettingsOpen).toHaveBeenCalledWith(true, 'skills');
+ expect(assign).not.toHaveBeenCalled();
+ });
+
+ it('navigates to platform skills URL when settings are disabled', () => {
+ useServerCapabilities.mockReturnValue({
+ sandbox: { enabled: true },
+ skill: { enabled: true },
+ settings: { enabled: false },
+ });
+
+ render(<AgentSkillsHeaderActionSlot platformSkillsUrl="/platform-skills" />);
+
+ fireEvent.click(screen.getByRole('button', { name: 'Register Skills' }));
+ expect(assign).toHaveBeenCalledWith('/platform-skills');
+ expect(setSettingsOpen).not.toHaveBeenCalled();
+ });
+
+ it('navigates to platform skills URL when skill catalog is absent', () => {
+ useOptionalCatalogServer.mockReturnValue(createMockCatalog() satisfies CatalogServer);
+
+ render(<AgentSkillsHeaderActionSlot platformSkillsUrl="/platform-skills" />);
+
+ fireEvent.click(screen.getByRole('button', { name: 'Register Skills' }));
+ expect(assign).toHaveBeenCalledWith('/platform-skills');
+ });
+
+ it('hides when neither settings skills nor a platform URL are available', () => {
+ useServerCapabilities.mockReturnValue({
+ sandbox: { enabled: true },
+ skill: { enabled: true },
+ settings: { enabled: false },
+ });
+ useOptionalCatalogServer.mockReturnValue(createMockCatalog() satisfies CatalogServer);
+
+ render(<AgentSkillsHeaderActionSlot platformSkillsUrl="" />);
+
+ expect(screen.queryByRole('button', { name: 'Register Skills' })).not.toBeInTheDocument();
+ });
+});
diff --git a/packages/trueforge-ui/test/atoms/draft/resolveSkillsNavigationUrls.test.ts b/packages/trueforge-ui/test/atoms/draft/resolveSkillsNavigationUrls.test.ts
new file mode 100644
index 000000000..85afeb16a
--- /dev/null
+++ b/packages/trueforge-ui/test/atoms/draft/resolveSkillsNavigationUrls.test.ts
@@ -0,0 +1,27 @@
+import { describe, expect, it } from 'vitest';
+
+import { resolveSettingsSkillsUrl } from '@/atoms/draft/resolveSkillsNavigationUrls.js';
+import { DEFAULT_SETTINGS_SKILLS_URL } from '@/atoms/draft/skillsNavigationDefaults.js';
+import { resolveRoutesConfig } from '@/routing/paths.js';
+
+describe('resolveSettingsSkillsUrl', () => {
+ it('prefixes the default settings path with router basename', () => {
+ const routes = resolveRoutesConfig({ basename: '/trueforge' });
+ expect(
+ resolveSettingsSkillsUrl({
+ settingsSkillsUrl: DEFAULT_SETTINGS_SKILLS_URL,
+ routes,
+ }),
+ ).toBe('/trueforge/settings');
+ });
+
+ it('leaves a host-provided settings URL unchanged', () => {
+ const routes = resolveRoutesConfig({ basename: '/trueforge' });
+ expect(
+ resolveSettingsSkillsUrl({
+ settingsSkillsUrl: '/custom/settings',
+ routes,
+ }),
+ ).toBe('/custom/settings');
+ });
+});
diff --git a/packages/trueforge-ui/test/atoms/primitives/CenteredModal.test.tsx b/packages/trueforge-ui/test/atoms/primitives/CenteredModal.test.tsx
index ed110f549..31029a01d 100644
--- a/packages/trueforge-ui/test/atoms/primitives/CenteredModal.test.tsx
+++ b/packages/trueforge-ui/test/atoms/primitives/CenteredModal.test.tsx
@@ -149,6 +149,23 @@ describe('CenteredModal', () => {
expect(screen.getByText('Modal content')).toBeInTheDocument();
});
+ it('renders titleAccessory immediately after the title', () => {
+ render(
+ <CenteredModal
+ open
+ onOpenChange={() => undefined}
+ title="Skills"
+ titleAccessory={<a href="/skills">Register Skills</a>}
+ >
+ Body
+ </CenteredModal>,
+ );
+
+ const title = screen.getByRole('heading', { name: 'Skills' });
+ const accessory = screen.getByRole('link', { name: 'Register Skills' });
+ expect(title.nextElementSibling).toBe(accessory);
+ });
+
it('uses the title as the label and omits description wiring when absent', () => {
render(
<CenteredModal open onOpenChange={() => undefined} title="Untitled description">
diff --git a/packages/trueforge-ui/test/publicUiExports.test.ts b/packages/trueforge-ui/test/publicUiExports.test.ts
index 766560518..aae7a03c3 100644
--- a/packages/trueforge-ui/test/publicUiExports.test.ts
+++ b/packages/trueforge-ui/test/publicUiExports.test.ts
@@ -30,6 +30,7 @@ const expectedRuntimeExports: Array<keyof typeof sdk> = [
'AgentRuntimeConfigDrawer',
'AgentRuntimeEditorContent',
'AgentSkillsEditorContent',
+ 'AgentSkillsHeaderActionSlot',
'AgentSessionsFilters',
'AgentStepsCard',
'AgentStepsContainer',
@@ -70,6 +71,8 @@ const expectedRuntimeExports: Array<keyof typeof sdk> = [
'CustomActionContainer',
'CustomActionRenderersProvider',
'DEFAULT_AGENT_CONFIG',
+ 'DEFAULT_PLATFORM_SKILLS_URL',
+ 'DEFAULT_SETTINGS_SKILLS_URL',
'DraftAgentConfigTrigger',
'DraftCapabilitiesPanel',
'DEFAULT_TABLE_PAGE_SIZE',