Skip to content

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

Extract frontend builder port and rename composer list helpers.

debajyoti-truefoundry76593eb77c87
diff --git a/packages/frontend/README.md b/packages/frontend/README.md
index 2d2f9e008..663ae2e6e 100644
--- a/packages/frontend/README.md
+++ b/packages/frontend/README.md
@@ -60,10 +60,11 @@ those on the fly.
docker compose up --build # UI + API on http://localhost:8791
```
-## Catalogs (model + MCP + skills)
+## Composer lists + builder (model + MCP + skills)
-[`src/catalog.ts`](src/catalog.ts) calls the DB-backed list endpoints via `trueforge`.
-`App.tsx` passes the results into `createTrueFoundryServer`:
+[`src/composerLists.ts`](src/composerLists.ts) calls the DB-backed list endpoints via `trueforge`.
+[`src/harnessBuilderServer.ts`](src/harnessBuilderServer.ts) maps those into `AgentBuilderServer`
+callbacks; `App.tsx` spreads them into `createTrueFoundryServer` (settings CRUD lives in `*Catalog.ts`):
| Callback | Source |
| -------------- | ----------------------------------------------------------------- |
diff --git a/packages/frontend/src/App.tsx b/packages/frontend/src/App.tsx
index addc570e0..cbb65bd0a 100644
--- a/packages/frontend/src/App.tsx
+++ b/packages/frontend/src/App.tsx
@@ -8,18 +8,14 @@ import {
} from '@truefoundry/trueforge-ui';
import { useEffect, useMemo, useRef, useState } from 'react';
import './agentUiSlots';
-import { getCapabilities, listMcpServers, listModels, listSkills } from './catalog';
+import { getCapabilities, listModels } from './composerLists';
import { createConnectorCatalog } from './connectorCatalog';
+import { createHarnessBuilderServer } from './harnessBuilderServer';
import { createHarnessChatServer, type HarnessAgentSpec } from './harnessServer';
import { createModelProviderCatalog } from './modelProviderCatalog';
import { createSandboxProviderCatalog } from './sandboxProviderCatalog';
import { createSkillCatalog } from './skillCatalog';
-/** Harness model names are `provider/model`. */
-function providerOf(name: string): string {
- return name.split('/')[0] ?? name;
-}
-
/** Opens settings once when the empty welcome screen mounts (no models configured). */
function OpenSettingsWelcomeScreen(props: WelcomeScreenProps) {
const { setSettingsOpen } = useShellMode();
@@ -36,18 +32,7 @@ function OpenSettingsWelcomeScreen(props: WelcomeScreenProps) {
const server = createTrueFoundryServer<HarnessAgentSpec>({
chatServer: createHarnessChatServer(),
- getModels: async () => (await listModels()).map(model => ({ name: model.name, provider: providerOf(model.name) })),
- // Skills require a configured sandbox provider; keep the picker empty when skill capability is off.
- getSkills: async () => {
- const [capabilities, skills] = await Promise.all([getCapabilities(), listSkills()]);
- return capabilities.skill.enabled
- ? skills.map(skill => ({ id: skill.name, name: skill.name, description: skill.description }))
- : [];
- },
- getMcp: async () =>
- (await listMcpServers()).map(server => ({ id: server.name, name: server.name, description: server.url })),
- searchAgents: () => Promise.resolve([]),
- saveAgent: () => Promise.reject(new Error('Harness has no agent registry — sessions are draft-only')),
+ ...createHarnessBuilderServer(),
catalog: {
modelCatalog: createModelProviderCatalog(),
connectorCatalog: createConnectorCatalog(),
diff --git a/packages/frontend/src/catalog.ts b/packages/frontend/src/composerLists.ts
similarity index 84%
rename from packages/frontend/src/catalog.ts
rename to packages/frontend/src/composerLists.ts
index 2af1459df..a548f734a 100644
--- a/packages/frontend/src/catalog.ts
+++ b/packages/frontend/src/composerLists.ts
@@ -1,4 +1,7 @@
-/** DB-backed catalog list helpers for the composer pickers and boot. */
+/**
+ * Configured-resource list helpers for composer pickers and app boot.
+ * Not the settings catalog ports (`*Catalog.ts`).
+ */
import type { TrueForgeApi as Harness } from 'trueforge';
import { harnessClient as client } from './harnessClient';
diff --git a/packages/frontend/src/harnessBuilderServer.ts b/packages/frontend/src/harnessBuilderServer.ts
new file mode 100644
index 000000000..ec053cbde
--- /dev/null
+++ b/packages/frontend/src/harnessBuilderServer.ts
@@ -0,0 +1,29 @@
+/**
+ * AgentBuilderServer callbacks for createTrueFoundryServer.
+ * Composer pickers + agent library stubs (Harness has no agent registry).
+ */
+import type { AgentBuilderServer } from '@truefoundry/trueforge-ui';
+import { getCapabilities, listMcpServers, listModels, listSkills } from './composerLists';
+import type { HarnessAgentSpec } from './harnessServer';
+
+/** Harness model names are `provider/model`. */
+export function providerOf(name: string): string {
+ return name.split('/')[0] ?? name;
+}
+
+export function createHarnessBuilderServer(): AgentBuilderServer<HarnessAgentSpec> {
+ return {
+ getModels: async () => (await listModels()).map(model => ({ name: model.name, provider: providerOf(model.name) })),
+ // Skills require a configured sandbox provider; keep the picker empty when skill capability is off.
+ getSkills: async () => {
+ const [capabilities, skills] = await Promise.all([getCapabilities(), listSkills()]);
+ return capabilities.skill.enabled
+ ? skills.map(skill => ({ id: skill.name, name: skill.name, description: skill.description }))
+ : [];
+ },
+ getMcp: async () =>
+ (await listMcpServers()).map(server => ({ id: server.name, name: server.name, description: server.url })),
+ searchAgents: () => Promise.resolve([]),
+ saveAgent: () => Promise.reject(new Error('Harness has no agent registry — sessions are draft-only')),
+ };
+}
diff --git a/packages/frontend/tests/harnessBuilderServer.test.ts b/packages/frontend/tests/harnessBuilderServer.test.ts
new file mode 100644
index 000000000..c019cd370
--- /dev/null
+++ b/packages/frontend/tests/harnessBuilderServer.test.ts
@@ -0,0 +1,14 @@
+import assert from 'node:assert/strict';
+import { describe, it } from 'node:test';
+import { providerOf } from '../src/harnessBuilderServer';
+
+describe('harnessBuilderServer', () => {
+ it('providerOf takes the segment before the first slash', () => {
+ assert.equal(providerOf('openai/gpt-4o'), 'openai');
+ assert.equal(providerOf('anthropic/claude-sonnet-4'), 'anthropic');
+ });
+
+ it('providerOf falls back to the full name when there is no slash', () => {
+ assert.equal(providerOf('gpt-4o'), 'gpt-4o');
+ });
+});