Skip to content

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

Update session CRUD to use registered MCP Server, model, skill names instead of inline (#34)

Srajan Asthana2b3669cdde64
diff --git a/Dockerfile b/Dockerfile
index 48ec89269..69fef3275 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -92,11 +92,6 @@ ENV FRONTEND_DIR=/app/packages/frontend/dist
WORKDIR /app/packages/server
-# The YAML registry (models.yaml, mcp.yaml, skills.yaml) is read at runtime from
-# ./registry and is provided via a volume mount rather than baked into the image.
-RUN mkdir -p registry
-VOLUME ["/app/packages/server/registry"]
-
EXPOSE 8790
CMD ["node", "dist/main.js"]
diff --git a/README.md b/README.md
index e43579cd0..09ff28ccc 100644
--- a/README.md
+++ b/README.md
@@ -17,10 +17,9 @@ The API and frontend run on the host with hot reload. Postgres and Redis run in
```bash
pnpm install
cp packages/server/.env.example packages/server/.env
-cp -R packages/server/registry-example packages/server/registry
```
-Fill in `MODEL_API_KEY` in `packages/server/.env`. The copied defaults already connect the host server to the Compose services.
+Fill in any required secrets in `packages/server/.env`. The copied defaults already connect the host server to the Compose services.
### Day-to-day
@@ -82,9 +81,9 @@ pnpm smoke # build, wait for healthy services, then check /healthz and the
pnpm smoke:down # stop the stack
```
-Open `http://localhost:8791`. Secrets and Postgres credentials come from `packages/server/.env` (`MODEL_API_KEY`, etc.). Host ports and in-network DB/Redis targets are fixed in Compose so they do not collide with development: Postgres `:5433`, Redis `:6380`, app `:8791` (vs `pnpm dev:infra` on `:5432`/`:6379` and `pnpm dev` on `:8790`/`:3000`).
+Open `http://localhost:8791`. Secrets and Postgres credentials come from `packages/server/.env`. Host ports and in-network DB/Redis targets are fixed in Compose so they do not collide with development: Postgres `:5433`, Redis `:6380`, app `:8791` (vs `pnpm dev:infra` on `:5432`/`:6379` and `pnpm dev` on `:8790`/`:3000`).
-Requires `packages/server/.env` and a `packages/server/registry/` directory (mounted read-only). `.env`, `registry/`, and `data/` are gitignored. Development infra stores Postgres under `./data/dev/postgres`.
+Requires `packages/server/.env`. `.env` and `data/` are gitignored. Development infra stores Postgres under `./data/dev/postgres`.
## SDK generation
diff --git a/docker-compose.yml b/docker-compose.yml
index b8583bc2e..9277d59c0 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,6 +1,6 @@
-# Full-stack smoke test. Reads packages/server/.env for secrets (e.g.
-# MODEL_API_KEY) and credentials; host ports and in-network DB/Redis targets
-# are opinionated here so they do not collide with or inherit host-dev values.
+# Full-stack smoke test. Reads packages/server/.env for secrets and
+# credentials; host ports and in-network DB/Redis targets are opinionated here
+# so they do not collide with or inherit host-dev values.
name: harness
services:
@@ -56,14 +56,11 @@ services:
# to true and drop the redis service entirely.
SINGLE_BINARY: 'false'
REDIS_URL: redis://redis:6379
- # Secrets and Postgres credentials (MODEL_API_KEY, POSTGRES_USER, …).
+ # Secrets and Postgres credentials (POSTGRES_USER, …).
# `environment` above overrides any colliding keys from this file.
env_file:
- path: packages/server/.env
required: true
- # Copy registry-example to registry before starting the service.
- volumes:
- - ./packages/server/registry:/app/packages/server/registry:ro
depends_on:
postgres:
condition: service_healthy
diff --git a/fern/openapi/openapi.json b/fern/openapi/openapi.json
index 29641fb82..649c4c5ca 100644
--- a/fern/openapi/openapi.json
+++ b/fern/openapi/openapi.json
@@ -111,7 +111,7 @@
},
"skills": {
"items": {
- "$ref": "#/components/schemas/SkillMount"
+ "$ref": "#/components/schemas/SkillNameRef"
},
"type": "array"
},
@@ -182,58 +182,6 @@
],
"type": "object"
},
- "AnthropicProviderModelEntry": {
- "additionalProperties": false,
- "properties": {
- "api_key": {
- "minLength": 1,
- "type": "string"
- },
- "base_url": {
- "format": "uri",
- "type": "string"
- },
- "headers": {
- "additionalProperties": {
- "type": "string"
- },
- "type": "object"
- },
- "max_output_tokens": {
- "exclusiveMinimum": 0,
- "type": "integer"
- },
- "model_id": {
- "minLength": 1,
- "type": "string"
- },
- "name": {
- "minLength": 1,
- "pattern": "^[a-z0-9][a-z0-9.-]*$",
- "type": "string"
- },
- "provider": {
- "enum": [
- "anthropic"
- ],
- "type": "string"
- },
- "reasoning_efforts": {
- "items": {
- "minLength": 1,
- "type": "string"
- },
- "minItems": 1,
- "type": "array"
- }
- },
- "required": [
- "name",
- "max_output_tokens",
- "provider"
- ],
- "type": "object"
- },
"ApprovalAllow": {
"properties": {
"status": {
@@ -472,6 +420,7 @@
"type",
"name",
"url",
+ "ref",
"description"
],
"type": "object"
@@ -739,65 +688,6 @@
],
"type": "object"
},
- "CustomProviderModelEntry": {
- "additionalProperties": false,
- "properties": {
- "api_format": {
- "enum": [
- "openai-chat-completions"
- ],
- "type": "string"
- },
- "api_key": {
- "minLength": 1,
- "type": "string"
- },
- "base_url": {
- "format": "uri",
- "type": "string"
- },
- "headers": {
- "additionalProperties": {
- "type": "string"
- },
- "type": "object"
- },
- "max_output_tokens": {
- "exclusiveMinimum": 0,
- "type": "integer"
- },
- "model_id": {
- "minLength": 1,
- "type": "string"
- },
- "name": {
- "minLength": 1,
- "pattern": "^[a-z0-9][a-z0-9.-]*$",
- "type": "string"
- },
- "provider": {
- "enum": [
- "custom"
- ],
- "type": "string"
- },
- "reasoning_efforts": {
- "items": {
- "minLength": 1,
- "type": "string"
- },
- "minItems": 1,
- "type": "array"
- }
- },
- "required": [
- "name",
- "max_output_tokens",
- "provider",
- "base_url"
- ],
- "type": "object"
- },
"DaytonaSandboxProvider": {
"additionalProperties": false,
"properties": {
@@ -971,34 +861,6 @@
],
"type": "object"
},
- "GetLegacyCapabilitiesResponse": {
- "properties": {
- "data": {
- "properties": {
- "sandbox": {
- "properties": {
- "enabled": {
- "description": "Whether this server has a sandbox provider configured via SANDBOX_SETTINGS.",
- "type": "boolean"
- }
- },
- "required": [
- "enabled"
- ],
- "type": "object"
- }
- },
- "required": [
- "sandbox"
- ],
- "type": "object"
- }
- },
- "required": [
- "data"
- ],
- "type": "object"
- },
"GetMcpServerCatalogResponse": {
"properties": {
"data": {
@@ -1088,58 +950,6 @@
],
"type": "object"
},
- "GoogleGeminiProviderModelEntry": {
- "additionalProperties": false,
- "properties": {
- "api_key": {
- "minLength": 1,
- "type": "string"
- },
- "base_url": {
- "format": "uri",
- "type": "string"
- },
- "headers": {
- "additionalProperties": {
- "type": "string"
- },
- "type": "object"
- },
- "max_output_tokens": {
- "exclusiveMinimum": 0,
- "type": "integer"
- },
- "model_id": {
- "minLength": 1,
- "type": "string"
- },
- "name": {
- "minLength": 1,
- "pattern": "^[a-z0-9][a-z0-9.-]*$",
- "type": "string"
- },
- "provider": {
- "enum": [
- "google-gemini"
- ],
- "type": "string"
- },
- "reasoning_efforts": {
- "items": {
- "minLength": 1,
- "type": "string"
- },
- "minItems": 1,
- "type": "array"
- }
- },
- "required": [
- "name",
- "max_output_tokens",
- "provider"
- ],
- "type": "object"
- },
"LargeToolResponseConfig": {
"default": {
"enabled": true
@@ -1208,49 +1018,6 @@
],
"type": "object"
},
- "ListLegacyModelsResponse": {
- "properties": {
- "data": {
- "items": {
- "allOf": [
- {
- "$ref": "#/components/schemas/ModelEntry"
- },
- {
- "discriminator": {
- "mapping": {
- "anthropic": "#/components/schemas/AnthropicProviderModelEntry",
- "custom": "#/components/schemas/CustomProviderModelEntry",
- "google-gemini": "#/components/schemas/GoogleGeminiProviderModelEntry",
- "openai": "#/components/schemas/OpenAIProviderModelEntry"
- },
- "propertyName": "provider"
- },
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAIProviderModelEntry"
- },
- {
- "$ref": "#/components/schemas/AnthropicProviderModelEntry"
- },
- {
- "$ref": "#/components/schemas/GoogleGeminiProviderModelEntry"
- },
- {
- "$ref": "#/components/schemas/CustomProviderModelEntry"
- }
- ]
- }
- ]
- },
- "type": "array"
- }
- },
- "required": [
- "data"
- ],
- "type": "object"
- },
"ListMcpServerToolsResponse": {
"properties": {
"data": {
@@ -1267,36 +1034,6 @@
],
"type": "object"
},
- "ListMcpServersResponse": {
- "properties": {
- "data": {
- "items": {
- "$ref": "#/components/schemas/McpServerEntry"
- },
- "type": "array"
- }
- },
- "required": [
- "data"
- ],
- "type": "object"
- },
- "ListMcpToolsResponse": {
- "properties": {
- "data": {
- "description": "MCP `tools/list` entries, passed through verbatim from the MCP server.",
- "items": {
- "additionalProperties": {},
- "type": "object"
- },
- "type": "array"
- }
- },
- "required": [
- "data"
- ],
- "type": "object"
- },
"ListModelProvidersResponse": {
"properties": {
"data": {
@@ -1370,20 +1107,6 @@
],
"type": "object"
},
- "ListSkillsResponse": {
- "properties": {
- "data": {
- "items": {
- "$ref": "#/components/schemas/SkillEntry"
- },
- "type": "array"
- }
- },
- "required": [
- "data"
- ],
- "type": "object"
- },
"ListTurnEventsOrder": {
"default": "asc",
"description": "Sort events by insertion order. Defaults to \"asc\".",
@@ -1694,67 +1417,18 @@
],
"type": "object"
},
- "McpServerAuthSettings": {
- "oneOf": [
- {
- "properties": {
- "type": {
- "enum": [
- "dcr"
- ],
- "type": "string"
- }
- },
- "required": [
- "type"
- ],
- "type": "object"
- }
- ]
- },
"McpServerDcrAuth": {
"additionalProperties": false,
- "properties": {
- "type": {
- "enum": [
- "dcr"
- ],
- "type": "string"
- }
- },
- "required": [
- "type"
- ],
- "type": "object"
- },
- "McpServerEntry": {
- "additionalProperties": false,
- "properties": {
- "auth": {
- "$ref": "#/components/schemas/McpServerAuthSettings"
- },
- "auth_status": {
- "description": "Passive check only: whether a stored, unexpired token exists. Never attempts a live refresh, so an expired-but-refreshable token still reads as `authentication_required` here. `not_required` for servers without `auth` configured.",
- "enum": [
- "authenticated",
- "authentication_required",
- "not_required"
- ],
- "type": "string"
- },
- "name": {
- "minLength": 1,
- "type": "string"
- },
- "url": {
- "format": "uri",
+ "properties": {
+ "type": {
+ "enum": [
+ "dcr"
+ ],
"type": "string"
}
},
"required": [
- "name",
- "url",
- "auth_status"
+ "type"
],
"type": "object"
},
@@ -2185,58 +1859,6 @@
],
"type": "object"
},
- "OpenAIProviderModelEntry": {
- "additionalProperties": false,
- "properties": {
- "api_key": {
- "minLength": 1,
- "type": "string"
- },
- "base_url": {
- "format": "uri",
- "type": "string"
- },
- "headers": {
- "additionalProperties": {
- "type": "string"
- },
- "type": "object"
- },
- "max_output_tokens": {
- "exclusiveMinimum": 0,
- "type": "integer"
- },
- "model_id": {
- "minLength": 1,
- "type": "string"
- },
- "name": {
- "minLength": 1,
- "pattern": "^[a-z0-9][a-z0-9.-]*$",
- "type": "string"
- },
- "provider": {
- "enum": [
- "openai"
- ],
- "type": "string"
- },
- "reasoning_efforts": {
- "items": {
- "minLength": 1,
- "type": "string"
- },
- "minItems": 1,
- "type": "array"
- }
- },
- "required": [
- "name",
- "max_output_tokens",
- "provider"
- ],
- "type": "object"
- },
"PreviousTurnIdInput": {
"anyOf": [
{
@@ -2686,37 +2308,6 @@
],
"type": "object"
},
- "SkillEntry": {
- "additionalProperties": false,
- "properties": {
- "description": {
- "minLength": 1,
- "type": "string"
- },
- "name": {
- "minLength": 1,
- "type": "string"
- },
- "path": {
- "minLength": 1,
- "type": "string"
- },
- "ref": {
- "minLength": 1,
- "type": "string"
- },
- "url": {
- "format": "uri",
- "type": "string"
- }
- },
- "required": [
- "name",
- "url",
- "description"
- ],
- "type": "object"
- },
"SkillManifest": {
"additionalProperties": false,
"properties": {
@@ -2754,55 +2345,24 @@
"type",
"name",
"url",
+ "ref",
"description"
],
"type": "object"
},
- "SkillMount": {
+ "SkillNameRef": {
+ "additionalProperties": false,
"properties": {
- "description": {
- "description": "Concise guidance for when the agent should use the skill.",
- "minLength": 1,
- "type": "string"
- },
"name": {
"description": "Name for the skill, used as directory name in sandbox.",
"maxLength": 64,
"minLength": 1,
"pattern": "^[A-Za-z0-9._-]+$",
"type": "string"
- },
- "path": {
- "description": "Path to the skill directory within the repository. Omit to use the repository root.",
- "minLength": 1,
- "pattern": "^[A-Za-z0-9._\\-/]+$",
- "type": "string"
- },
- "ref": {
- "description": "Git ref — branch name, tag, or commit SHA.",
- "minLength": 1,
- "pattern": "^[A-Za-z0-9._\\-/]+$",
- "type": "string"
- },
- "type": {
- "enum": [
- "git"
- ],
- "type": "string"
- },
- "url": {
- "description": "Full HTTPS URL of a GitHub or GitLab repository.",
- "minLength": 1,
- "pattern": "^https:\\/\\/(github\\.com\\/[A-Za-z0-9._-]+\\/[A-Za-z0-9._-]+|gitlab\\.com\\/[A-Za-z0-9._-]+(?:\\/[A-Za-z0-9._-]+)+)(\\/|\\.git)?$",
- "type": "string"
}
},
"required": [
- "type",
- "url",
- "name",
- "description",
- "ref"
+ "name"
],
"type": "object"
},
@@ -3670,7 +3230,7 @@
}
},
"info": {
- "description": "Agent server exposing models, MCP servers and skills from local YAML config.",
+ "description": "Agent server with DB-backed sessions, settings catalogs, and model/MCP/skill providers.",
"title": "Agent Server",
"version": "0.1.0"
},
@@ -3701,179 +3261,6 @@
"x-fern-sdk-method-name": "get_capabilities"
}
},
- "/api/v1/legacy/capabilities": {
- "get": {
- "description": "Report optional runtime capabilities from boot-time SANDBOX_SETTINGS. Prefer GET /api/v1/capabilities for new clients.",
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetLegacyCapabilitiesResponse"
- }
- }
- },
- "description": "Server capabilities (legacy)."
- }
- },
- "summary": "Get server capabilities (legacy)",
- "tags": [
- "Legacy Capabilities"
- ],
- "x-fern-sdk-group-name": [
- "legacy",
- "server"
- ],
- "x-fern-sdk-method-name": "get_capabilities"
- }
- },
- "/api/v1/legacy/mcp-servers": {
- "get": {
- "description": "MCP servers declared in mcp.yaml, each with a passive auth_status snapshot. Auth headers are configured via env vars and never returned.",
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ListMcpServersResponse"
- }
- }
- },
- "description": "All configured MCP servers."
- }
- },
- "summary": "List MCP servers",
- "tags": [
- "Legacy MCP Servers"
- ],
- "x-fern-sdk-group-name": [
- "legacy",
- "mcp_servers"
- ],
- "x-fern-sdk-method-name": "list"
- }
- },
- "/api/v1/legacy/mcp-servers/{name}/tools": {
- "get": {
- "description": "All tools exposed by the given MCP server (non-paginated), as returned by the MCP `tools/list` call. No agent-spec tool selectors are applied — this is the raw server catalog.",
- "parameters": [
- {
- "description": "MCP server name from mcp.yaml.",
- "in": "path",
- "name": "name",
- "required": true,
- "schema": {
- "description": "MCP server name from mcp.yaml.",
- "minLength": 1,
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ListMcpToolsResponse"
- }
- }
- },
- "description": "All tools of the MCP server."
- },
- "401": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RequestErrorResponse"
- }
- }
- },
- "description": "The MCP server requires authentication (configure MCP_HEADERS / MCP_{NAME}_HEADERS)."
- },
- "404": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RequestErrorResponse"
- }
- }
- },
- "description": "MCP server not declared in mcp.yaml."
- },
- "502": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RequestErrorResponse"
- }
- }
- },
- "description": "The MCP server could not be reached or returned an error."
- }
- },
- "summary": "List tools of an MCP server",
- "tags": [
- "Legacy MCP Servers"
- ],
- "x-fern-sdk-group-name": [
- "legacy",
- "mcp_servers"
- ],
- "x-fern-sdk-method-name": "list_tools"
- }
- },
- "/api/v1/legacy/models": {
- "get": {
- "description": "Models declared in models.yaml — the registry the runtime still uses for turns.",
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ListLegacyModelsResponse"
- }
- }
- },
- "description": "All configured models."
- }
- },
- "summary": "List models (models.yaml)",
- "tags": [
- "Legacy Models"
- ],
- "x-fern-sdk-group-name": [
- "legacy",
- "models"
- ],
- "x-fern-sdk-method-name": "list"
- }
- },
- "/api/v1/legacy/skills": {
- "get": {
- "description": "Agent skills declared in skills.yaml.",
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ListSkillsResponse"
- }
- }
- },
- "description": "All configured skills."
- }
- },
- "summary": "List skills",
- "tags": [
- "Legacy Skills"
- ],
- "x-fern-sdk-group-name": [
- "legacy",
- "skills"
- ],
- "x-fern-sdk-method-name": "list"
- }
- },
"/api/v1/mcp-servers": {
"get": {
"description": "Configured MCP servers as a slim name/url list for the composer. No auth or auth_status.",
diff --git a/packages/frontend/README.md b/packages/frontend/README.md
index 29efe4a6c..1e5882ecd 100644
--- a/packages/frontend/README.md
+++ b/packages/frontend/README.md
@@ -31,13 +31,13 @@ moves Vite off `:3000`. That proxy is the only dev-specific wiring and lives ent
### Session paths
The gateway SDK's session routes sit under `/v1/agents`, with draft sessions as a separate resource. The
-harness serves one `/api/v1/sessions` surface, so [`src/harnessFetch.ts`](src/harnessFetch.ts) rewrites
-requests on their way out and is handed to both clients as their `fetch`:
+harness YAML-backed surface is `/api/v1/legacy/sessions`, so [`src/harnessFetch.ts`](src/harnessFetch.ts)
+rewrites requests on their way out and is handed to both clients as their `fetch`:
-| SDK request | Harness route |
-| ---------------------------- | ------------------- |
-| `/v1/agents/draft-sessions*` | `/api/v1/sessions*` |
-| `/v1/agents/sessions*` | `/api/v1/sessions*` |
+| SDK request | Harness route |
+| ---------------------------- | -------------------------- |
+| `/v1/agents/draft-sessions*` | `/api/v1/legacy/sessions*` |
+| `/v1/agents/sessions*` | `/api/v1/legacy/sessions*` |
It runs in the browser, so the mapping is identical in dev and production; the dev proxy just forwards.
diff --git a/packages/frontend/src/harnessFetch.ts b/packages/frontend/src/harnessFetch.ts
index 24f92e79d..594aa0d91 100644
--- a/packages/frontend/src/harnessFetch.ts
+++ b/packages/frontend/src/harnessFetch.ts
@@ -1,12 +1,13 @@
/**
- * The gateway SDK targets /v1/agents with draft sessions as a separate resource; the harness serves one
- * /api/v1/sessions surface. Handed to the SDK clients as their `fetch`, this is the only place that knows.
+ * The gateway SDK targets /v1/agents with draft sessions as a separate resource; the harness
+ * YAML-backed surface is /api/v1/legacy/sessions. Handed to the SDK clients as their `fetch`,
+ * this is the only place that knows.
*/
const SESSION_PATH = /^(https?:\/\/[^/]+)?\/v1\/agents\/(?:draft-)?sessions(?=$|[/?])/;
export function toHarnessUrl(url: string): string {
- return url.replace(SESSION_PATH, '$1/api/v1/sessions');
+ return url.replace(SESSION_PATH, '$1/api/v1/legacy/sessions');
}
export const harnessFetch: typeof fetch = (input, init) => {
diff --git a/packages/frontend/tests/harnessFetch.test.ts b/packages/frontend/tests/harnessFetch.test.ts
index cd8afd74f..d2e4b090d 100644
--- a/packages/frontend/tests/harnessFetch.test.ts
+++ b/packages/frontend/tests/harnessFetch.test.ts
@@ -3,29 +3,29 @@ import { describe, it } from 'node:test';
import { harnessFetch, toHarnessUrl } from '../src/harnessFetch';
describe('toHarnessUrl', () => {
- it('maps both session prefixes onto /api/v1/sessions', () => {
- assert.equal(toHarnessUrl('/v1/agents/draft-sessions'), '/api/v1/sessions');
- assert.equal(toHarnessUrl('/v1/agents/sessions'), '/api/v1/sessions');
- assert.equal(toHarnessUrl('/v1/agents/sessions/ses_1/turns'), '/api/v1/sessions/ses_1/turns');
- assert.equal(toHarnessUrl('/v1/agents/draft-sessions?limit=10'), '/api/v1/sessions?limit=10');
+ it('maps both session prefixes onto /api/v1/legacy/sessions', () => {
+ assert.equal(toHarnessUrl('/v1/agents/draft-sessions'), '/api/v1/legacy/sessions');
+ assert.equal(toHarnessUrl('/v1/agents/sessions'), '/api/v1/legacy/sessions');
+ assert.equal(toHarnessUrl('/v1/agents/sessions/ses_1/turns'), '/api/v1/legacy/sessions/ses_1/turns');
+ assert.equal(toHarnessUrl('/v1/agents/draft-sessions?limit=10'), '/api/v1/legacy/sessions?limit=10');
});
it('preserves the origin of absolute urls', () => {
assert.equal(
toHarnessUrl('http://localhost:8790/v1/agents/sessions/ses_1'),
- 'http://localhost:8790/api/v1/sessions/ses_1',
+ 'http://localhost:8790/api/v1/legacy/sessions/ses_1',
);
});
it('leaves other paths untouched', () => {
assert.equal(toHarnessUrl('/api/v1/models'), '/api/v1/models');
- assert.equal(toHarnessUrl('/api/v1/sessions/ses_1'), '/api/v1/sessions/ses_1');
+ assert.equal(toHarnessUrl('/api/v1/legacy/sessions/ses_1'), '/api/v1/legacy/sessions/ses_1');
// A longer segment only shares the prefix; it is a different route.
assert.equal(toHarnessUrl('/v1/agents/sessions-archive'), '/v1/agents/sessions-archive');
// Only the path is matched, so a prefix inside the query means nothing.
assert.equal(
- toHarnessUrl('/api/v1/sessions?next=/v1/agents/sessions'),
- '/api/v1/sessions?next=/v1/agents/sessions',
+ toHarnessUrl('/api/v1/legacy/sessions?next=/v1/agents/sessions'),
+ '/api/v1/legacy/sessions?next=/v1/agents/sessions',
);
});
});
@@ -48,9 +48,9 @@ describe('harnessFetch', () => {
}
assert.deepEqual(seen, [
- '/api/v1/sessions',
- 'http://localhost:8790/api/v1/sessions',
- 'http://localhost:8790/api/v1/sessions/ses_1',
+ '/api/v1/legacy/sessions',
+ 'http://localhost:8790/api/v1/legacy/sessions',
+ 'http://localhost:8790/api/v1/legacy/sessions/ses_1',
]);
});
@@ -62,7 +62,10 @@ describe('harnessFetch', () => {
return Promise.resolve(new Response('ok'));
};
- const request = new Request('http://localhost:8790/api/v1/sessions', { method: 'POST', body: '{"a":1}' });
+ const request = new Request('http://localhost:8790/api/v1/legacy/sessions', {
+ method: 'POST',
+ body: '{"a":1}',
+ });
try {
await harnessFetch(request);
} finally {
diff --git a/packages/harness/src/agent-session/index.ts b/packages/harness/src/agent-session/index.ts
index 09c803814..b73391cf9 100644
--- a/packages/harness/src/agent-session/index.ts
+++ b/packages/harness/src/agent-session/index.ts
@@ -4,7 +4,7 @@
*/
export { AgentSpecSchema, DEFAULT_AGENT_CONFIG_ITERATION_LIMIT, RuntimeConfigSchema } from './schemas/agentSpec';
-export type { AgentSpec, SkillMount } from './schemas/agentSpec';
+export type { AgentSpec, SkillNameRef } from './schemas/agentSpec';
export {
CancellationReason,
diff --git a/packages/harness/src/agent-session/schemas/agentSpec.ts b/packages/harness/src/agent-session/schemas/agentSpec.ts
index 7f140708d..2a77c986e 100644
--- a/packages/harness/src/agent-session/schemas/agentSpec.ts
+++ b/packages/harness/src/agent-session/schemas/agentSpec.ts
@@ -1,4 +1,4 @@
-/** AgentSpec wire schema — the inline agent definition a session is created with. */
+/** DB AgentSpec wire schema — FQN model names and name-only skill refs. */
import { z } from '@hono/zod-openapi';
import { DEFAULT_CONTEXT_COMPACTION_THRESHOLD_TOKENS } from '../../core/capabilities/builtins/ContextCompaction';
import {
@@ -32,9 +32,21 @@ const ModelParamsSchema = z
.passthrough() // this ensures extra model params are allowed
.openapi('ModelParams');
+/** Same shape as server `parseModelFqn`: exactly one slash, non-empty provider and model. */
+function isModelFqn(name: string): boolean {
+ const slash = name.indexOf('/');
+ if (slash <= 0 || slash === name.length - 1) {
+ return false;
+ }
+ return !name.includes('/', slash + 1);
+}
+
const ModelSpecSchema = z
.object({
- name: z.string().min(1, 'model.name must not be empty'),
+ name: z
+ .string()
+ .min(1, 'model.name must not be empty')
+ .refine(isModelFqn, { message: 'model.name must be a fully qualified "provider/model"' }),
params: ModelParamsSchema.optional(),
})
.openapi('Model');
@@ -57,8 +69,7 @@ const RequireApprovalToolSelectorSchema = z.union([
]);
// `preload` defaults to false; use `preload_tools` to eagerly load specific tools when not fully preloading.
-// Auth headers are not part of the spec — they come from the MCP_HEADERS /
-// MCP_{NAME}_HEADERS env vars.
+// Auth headers are not part of the spec — they come from the configured MCP server store.
const MCPServerRequestSchema = z
.object({
name: z.string().min(1, 'mcp_servers[].name must not be empty'),
@@ -199,37 +210,13 @@ export const RuntimeConfigSchema = z
.openapi('RuntimeConfig');
// --- Skills ---
-// Git mounts mirror the gateway SkillMountGitSchema. The sandbox git_downloader
-// resolves `ref` (branch/tag/SHA) to an object id before sparse-cloning.
+// Name-only refs; DB sessions expand mount fields from ISkillStore at turn time.
-// GitHub is exactly owner/repo; GitLab allows subgroups (group[/subgroup...]/project, ≥2 segments).
-const GIT_URL_REGEX =
- /^https:\/\/(github\.com\/[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+|gitlab\.com\/[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)+)(\/|\.git)?$/;
-const GIT_REF_REGEX = /^[A-Za-z0-9._\-/]+$/;
const SKILL_NAME_REGEX = /^[A-Za-z0-9._-]+$/;
-const SKILL_PATH_REGEX = /^[A-Za-z0-9._\-/]+$/;
-const hasParentTraversal = (value: string): boolean => value.split('/').includes('..');
-const SkillMountSchema = z
+/** Name-only skill selection; mount fields come from the skill store. */
+const SkillNameRefSchema = z
.object({
- type: z.literal('git'),
- url: z
- .string()
- .trim()
- .min(1)
- .regex(GIT_URL_REGEX, 'Must be a GitHub or GitLab HTTPS URL')
- .refine(v => !hasParentTraversal(v), 'URL must not contain ".." segments')
- .describe('Full HTTPS URL of a GitHub or GitLab repository.'),
- path: z
- .string()
- .trim()
- .min(1)
- .regex(SKILL_PATH_REGEX, 'Path may only contain letters, numbers, ".", "_", "-", and "/"')
- .refine(v => !hasParentTraversal(v), 'Path must not contain ".." segments')
- .refine(v => !v.split('/').includes('.'), 'Path must not contain "." segments')
- .refine(v => v.replace(/^\/+|\/+$/g, '').length > 0, 'Path must reference a subdirectory, not only slashes')
- .optional()
- .describe('Path to the skill directory within the repository. Omit to use the repository root.'),
name: z
.string()
.trim()
@@ -239,17 +226,9 @@ const SkillMountSchema = z
.refine(v => v !== '.' && v !== '..', 'Name must not be "." or ".."')
.refine(v => !v.startsWith('.tfy-'), 'Name must not use the reserved ".tfy-" prefix')
.describe('Name for the skill, used as directory name in sandbox.'),
- description: z.string().trim().min(1).describe('Concise guidance for when the agent should use the skill.'),
- ref: z
- .string()
- .trim()
- .min(1)
- .regex(GIT_REF_REGEX, 'Ref may only contain letters, numbers, ".", "_", "-", and "/"')
- .refine(v => !hasParentTraversal(v), 'Ref must not contain ".." segments')
- .refine(v => v.replace(/^\/+|\/+$/g, '').length > 0, 'Ref must not consist only of slashes')
- .describe('Git ref — branch name, tag, or commit SHA.'),
})
- .openapi('SkillMount');
+ .strict()
+ .openapi('SkillNameRef');
// --- Response format / messages ---
@@ -272,7 +251,7 @@ export const AgentSpecSchema = z
messages: z.array(AgentSpecUserMessageSchema).optional(),
mcp_servers: z.array(MCPServerRequestSchema).optional(),
response_format: ResponseFormatSchema.optional(),
- skills: z.array(SkillMountSchema).optional(),
+ skills: z.array(SkillNameRefSchema).optional(),
config: RuntimeConfigSchema.optional(),
variables: z.record(z.string(), z.string()).optional(),
})
@@ -280,4 +259,4 @@ export const AgentSpecSchema = z
.openapi('AgentSpec');
export type AgentSpec = z.infer<typeof AgentSpecSchema>;
-export type SkillMount = z.infer<typeof SkillMountSchema>;
+export type SkillNameRef = z.infer<typeof SkillNameRefSchema>;
diff --git a/packages/harness/tests/agent-session/agentSpecSkills.test.ts b/packages/harness/tests/agent-session/agentSpecSkills.test.ts
new file mode 100644
index 000000000..d8221a2cf
--- /dev/null
+++ b/packages/harness/tests/agent-session/agentSpecSkills.test.ts
@@ -0,0 +1,19 @@
+import { AgentSpecSchema } from '../../src/agent-session/schemas/agentSpec';
+
+describe('AgentSpecSchema skills', () => {
+ it('accepts name-only SkillNameRef entries', () => {
+ const parsed = AgentSpecSchema.parse({
+ model: { name: 'test-provider/test-model' },
+ skills: [{ name: 'my-skill' }],
+ });
+ expect(parsed.skills).toEqual([{ name: 'my-skill' }]);
+ });
+
+ it('rejects skill mounts with extra fields', () => {
+ const result = AgentSpecSchema.safeParse({
+ model: { name: 'test-provider/test-model' },
+ skills: [{ name: 'my-skill', type: 'git', url: 'https://github.com/acme/skills' }],
+ });
+ expect(result.success).toBe(false);
+ });
+});
diff --git a/packages/harness/tests/agent-session/schemas/agentSpecSkills.test.ts b/packages/harness/tests/agent-session/schemas/agentSpecSkills.test.ts
deleted file mode 100644
index d7be85a45..000000000
--- a/packages/harness/tests/agent-session/schemas/agentSpecSkills.test.ts
+++ /dev/null
@@ -1,99 +0,0 @@
-import { AgentSpecSchema } from '../../../src/agent-session/schemas/agentSpec';
-
-const base = {
- model: { name: 'test-model' },
-};
-
-describe('AgentSpecSchema skills (git mounts)', () => {
- it('accepts a git skill mount', () => {
- const spec = AgentSpecSchema.parse({
- ...base,
- skills: [
- {
- type: 'git',
- url: 'https://github.com/acme/skills',
- path: 'skills/pr-review',
- name: 'pr-review',
- description: 'Reviews pull requests',
- ref: 'main',
- },
- ],
- });
- expect(spec.skills).toEqual([
- {
- type: 'git',
- url: 'https://github.com/acme/skills',
- path: 'skills/pr-review',
- name: 'pr-review',
- description: 'Reviews pull requests',
- ref: 'main',
- },
- ]);
- });
-
- it('accepts a full commit SHA as ref', () => {
- const sha = 'a'.repeat(40);
- const spec = AgentSpecSchema.parse({
- ...base,
- skills: [
- {
- type: 'git',
- url: 'https://github.com/acme/skills',
- name: 'pr-review',
- description: 'Reviews pull requests',
- ref: sha,
- },
- ],
- });
- expect(spec.skills?.[0]?.ref).toBe(sha);
- });
-
- it('rejects the legacy name/preload skill shape', () => {
- const result = AgentSpecSchema.safeParse({
- ...base,
- skills: [{ name: 'pr-review', preload: false }],
- });
- expect(result.success).toBe(false);
- });
-
- it('rejects a git skill mount without a description', () => {
- const result = AgentSpecSchema.safeParse({
- ...base,
- skills: [
- {
- type: 'git',
- url: 'https://github.com/acme/skills',
- name: 'pr-review',
- ref: 'main',
- },
- ],
- });
- expect(result.success).toBe(false);
- });
-
- it('strips unknown commit_sha from a git skill mount', () => {
- const result = AgentSpecSchema.safeParse({
- ...base,
- skills: [
- {
- type: 'git',
- url: 'https://github.com/acme/skills',
- name: 'pr-review',
- description: 'Reviews pull requests',
- ref: 'main',
- commit_sha: 'a'.repeat(40),
- },
- ],
- });
- expect(result.success).toBe(true);
- if (result.success) {
- expect(result.data.skills?.[0]).toEqual({
- type: 'git',
- url: 'https://github.com/acme/skills',
- name: 'pr-review',
- description: 'Reviews pull requests',
- ref: 'main',
- });
- }
- });
-});
diff --git a/packages/harness/tests/agent-session/store/storeContractSuite.ts b/packages/harness/tests/agent-session/store/storeContractSuite.ts
index 71667e479..ec0bf876a 100644
--- a/packages/harness/tests/agent-session/store/storeContractSuite.ts
+++ b/packages/harness/tests/agent-session/store/storeContractSuite.ts
@@ -166,7 +166,7 @@ export function runStoreContractSuite(createStore: () => ISessionStore) {
const session = await store.getSession({ tenant_id: tenant, session_id: sessionId });
expect(session).toBeDefined();
expect(mustGet(session).tenant_id).toBe(tenant);
- expect(mustGet(session).agent_spec.model.name).toBe('test-model');
+ expect(mustGet(session).agent_spec.model.name).toBe('test-provider/test-model');
expect(mustGet(session).last_activity_timestamp_ms).toBeGreaterThanOrEqual(before);
expect(mustGet(session).title).toBeNull();
});
diff --git a/packages/harness/tests/agent-session/testHelpers.ts b/packages/harness/tests/agent-session/testHelpers.ts
index a741bd437..047d9d297 100644
--- a/packages/harness/tests/agent-session/testHelpers.ts
+++ b/packages/harness/tests/agent-session/testHelpers.ts
@@ -25,7 +25,7 @@ export function mintTestTurnId(): string {
return ulid().toLowerCase();
}
-/** Minimal AgentSpec for session/turn tests — interactive builtins off. */
+/** Minimal AgentSpec for session/turn tests — interactive builtins off; FQN model required. */
export function makeAgentSpec(
overrides: {
instructions?: string;
@@ -44,7 +44,7 @@ export function makeAgentSpec(
} = {},
): AgentSpec {
return AgentSpecSchema.parse({
- model: overrides.model ?? { name: 'test-model' },
+ model: overrides.model ?? { name: 'test-provider/test-model' },
instructions: overrides.instructions ?? 'You are a test agent.',
config: {
iteration_limit: 5,
diff --git a/packages/sdk/.fern/metadata.json b/packages/sdk/.fern/metadata.json
index 972ef0013..04ab6bc9f 100644
--- a/packages/sdk/.fern/metadata.json
+++ b/packages/sdk/.fern/metadata.json
@@ -26,10 +26,9 @@
"streamType": "web",
"useDefaultRequestParameterValues": true
},
- "originGitCommit": "7ccfd4dcd9e1fff92c74869574e01c028af33b84",
+ "originGitCommit": "c68f72c27b9ce6d2bfd0f7a67be173c1aec5a8cc",
"originGitCommitIsDirty": true,
- "invokedBy": "ci",
+ "invokedBy": "manual",
"requestedVersion": "0.0.0",
- "ciProvider": "github",
"sdkVersion": "0.0.0"
}
diff --git a/packages/sdk/package.json b/packages/sdk/package.json
index 6d95e3525..6a3c784dc 100644
--- a/packages/sdk/package.json
+++ b/packages/sdk/package.json
@@ -84,61 +84,6 @@
},
"default": "./dist/cjs/api/resources/skills/exports.js"
},
- "./legacy": {
- "import": {
- "types": "./dist/esm/api/resources/legacy/exports.d.mts",
- "default": "./dist/esm/api/resources/legacy/exports.mjs"
- },
- "require": {
- "types": "./dist/cjs/api/resources/legacy/exports.d.ts",
- "default": "./dist/cjs/api/resources/legacy/exports.js"
- },
- "default": "./dist/cjs/api/resources/legacy/exports.js"
- },
- "./legacy/server": {
- "import": {
- "types": "./dist/esm/api/resources/legacy/resources/server/exports.d.mts",
- "default": "./dist/esm/api/resources/legacy/resources/server/exports.mjs"
- },
- "require": {
- "types": "./dist/cjs/api/resources/legacy/resources/server/exports.d.ts",
- "default": "./dist/cjs/api/resources/legacy/resources/server/exports.js"
- },
- "default": "./dist/cjs/api/resources/legacy/resources/server/exports.js"
- },
- "./legacy/mcpServers": {
- "import": {
- "types": "./dist/esm/api/resources/legacy/resources/mcpServers/exports.d.mts",
- "default": "./dist/esm/api/resources/legacy/resources/mcpServers/exports.mjs"
- },
- "require": {
- "types": "./dist/cjs/api/resources/legacy/resources/mcpServers/exports.d.ts",
- "default": "./dist/cjs/api/resources/legacy/resources/mcpServers/exports.js"
- },
- "default": "./dist/cjs/api/resources/legacy/resources/mcpServers/exports.js"
- },
- "./legacy/models": {
- "import": {
- "types": "./dist/esm/api/resources/legacy/resources/models/exports.d.mts",
- "default": "./dist/esm/api/resources/legacy/resources/models/exports.mjs"
- },
- "require": {
- "types": "./dist/cjs/api/resources/legacy/resources/models/exports.d.ts",
- "default": "./dist/cjs/api/resources/legacy/resources/models/exports.js"
- },
- "default": "./dist/cjs/api/resources/legacy/resources/models/exports.js"
- },
- "./legacy/skills": {
- "import": {
- "types": "./dist/esm/api/resources/legacy/resources/skills/exports.d.mts",
- "default": "./dist/esm/api/resources/legacy/resources/skills/exports.mjs"
- },
- "require": {
- "types": "./dist/cjs/api/resources/legacy/resources/skills/exports.d.ts",
- "default": "./dist/cjs/api/resources/legacy/resources/skills/exports.js"
- },
- "default": "./dist/cjs/api/resources/legacy/resources/skills/exports.js"
- },
"./settings": {
"import": {
"types": "./dist/esm/api/resources/settings/exports.d.mts",
diff --git a/packages/sdk/reference.md b/packages/sdk/reference.md
index cc558d223..77bbf9d8d 100644
--- a/packages/sdk/reference.md
+++ b/packages/sdk/reference.md
@@ -1074,293 +1074,6 @@ await client.skills.list();
</dl>
-</dd>
-</dl>
-</details>
-
-## Legacy Server
-<details><summary><code>client.legacy.server.<a href="/src/api/resources/legacy/resources/server/client/Client.ts">getCapabilities</a>() -> TrueHarness.GetLegacyCapabilitiesResponse</code></summary>
-<dl>
-<dd>
-
-#### 📝 Description
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-Report optional runtime capabilities from boot-time SANDBOX_SETTINGS. Prefer GET /api/v1/capabilities for new clients.
-</dd>
-</dl>
-</dd>
-</dl>
-
-#### 🔌 Usage
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-```typescript
-await client.legacy.server.getCapabilities();
-
-```
-</dd>
-</dl>
-</dd>
-</dl>
-
-#### ⚙️ Parameters
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-**requestOptions:** `ServerClient.RequestOptions`
-
-</dd>
-</dl>
-</dd>
-</dl>
-
-
-</dd>
-</dl>
-</details>
-
-## Legacy McpServers
-<details><summary><code>client.legacy.mcpServers.<a href="/src/api/resources/legacy/resources/mcpServers/client/Client.ts">list</a>() -> TrueHarness.ListMcpServersResponse</code></summary>
-<dl>
-<dd>
-
-#### 📝 Description
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-MCP servers declared in mcp.yaml, each with a passive auth_status snapshot. Auth headers are configured via env vars and never returned.
-</dd>
-</dl>
-</dd>
-</dl>
-
-#### 🔌 Usage
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-```typescript
-await client.legacy.mcpServers.list();
-
-```
-</dd>
-</dl>
-</dd>
-</dl>
-
-#### ⚙️ Parameters
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-**requestOptions:** `McpServersClient.RequestOptions`
-
-</dd>
-</dl>
-</dd>
-</dl>
-
-
-</dd>
-</dl>
-</details>
-
-<details><summary><code>client.legacy.mcpServers.<a href="/src/api/resources/legacy/resources/mcpServers/client/Client.ts">listTools</a>(name) -> TrueHarness.ListMcpToolsResponse</code></summary>
-<dl>
-<dd>
-
-#### 📝 Description
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-All tools exposed by the given MCP server (non-paginated), as returned by the MCP `tools/list` call. No agent-spec tool selectors are applied — this is the raw server catalog.
-</dd>
-</dl>
-</dd>
-</dl>
-
-#### 🔌 Usage
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-```typescript
-await client.legacy.mcpServers.listTools("name");
-
-```
-</dd>
-</dl>
-</dd>
-</dl>
-
-#### ⚙️ Parameters
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-**name:** `string` — MCP server name from mcp.yaml.
-
-</dd>
-</dl>
-
-<dl>
-<dd>
-
-**requestOptions:** `McpServersClient.RequestOptions`
-
-</dd>
-</dl>
-</dd>
-</dl>
-
-
-</dd>
-</dl>
-</details>
-
-## Legacy Models
-<details><summary><code>client.legacy.models.<a href="/src/api/resources/legacy/resources/models/client/Client.ts">list</a>() -> TrueHarness.ListLegacyModelsResponse</code></summary>
-<dl>
-<dd>
-
-#### 📝 Description
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-Models declared in models.yaml — the registry the runtime still uses for turns.
-</dd>
-</dl>
-</dd>
-</dl>
-
-#### 🔌 Usage
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-```typescript
-await client.legacy.models.list();
-
-```
-</dd>
-</dl>
-</dd>
-</dl>
-
-#### ⚙️ Parameters
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-**requestOptions:** `ModelsClient.RequestOptions`
-
-</dd>
-</dl>
-</dd>
-</dl>
-
-
-</dd>
-</dl>
-</details>
-
-## Legacy Skills
-<details><summary><code>client.legacy.skills.<a href="/src/api/resources/legacy/resources/skills/client/Client.ts">list</a>() -> TrueHarness.ListSkillsResponse</code></summary>
-<dl>
-<dd>
-
-#### 📝 Description
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-Agent skills declared in skills.yaml.
-</dd>
-</dl>
-</dd>
-</dl>
-
-#### 🔌 Usage
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-```typescript
-await client.legacy.skills.list();
-
-```
-</dd>
-</dl>
-</dd>
-</dl>
-
-#### ⚙️ Parameters
-
-<dl>
-<dd>
-
-<dl>
-<dd>
-
-**requestOptions:** `SkillsClient.RequestOptions`
-
-</dd>
-</dl>
-</dd>
-</dl>
-
-
</dd>
</dl>
</details>
@@ -2134,6 +1847,7 @@ Full upsert keyed by `name`: creates the skill or replaces its entire manifest.
await client.settings.skills.upsert({
description: "description",
name: "name",
+ ref: "ref",
type: "git",
url: "url"
});
diff --git a/packages/sdk/src/Client.ts b/packages/sdk/src/Client.ts
index 86df988d6..42098013a 100644
--- a/packages/sdk/src/Client.ts
+++ b/packages/sdk/src/Client.ts
@@ -1,6 +1,5 @@
// This file was auto-generated by Fern from our API Definition.
-import { LegacyClient } from "./api/resources/legacy/client/Client.js";
import { McpServersClient } from "./api/resources/mcpServers/client/Client.js";
import { ModelsClient } from "./api/resources/models/client/Client.js";
import { ServerClient } from "./api/resources/server/client/Client.js";
@@ -24,7 +23,6 @@ export class TrueHarness {
protected _models: ModelsClient | undefined;
protected _sessions: SessionsClient | undefined;
protected _skills: SkillsClient | undefined;
- protected _legacy: LegacyClient | undefined;
protected _settings: SettingsClient | undefined;
constructor(options: TrueHarness.Options) {
@@ -51,10 +49,6 @@ export class TrueHarness {
return (this._skills ??= new SkillsClient(this._options));
}
- public get legacy(): LegacyClient {
- return (this._legacy ??= new LegacyClient(this._options));
- }
-
public get settings(): SettingsClient {
return (this._settings ??= new SettingsClient(this._options));
}
diff --git a/packages/sdk/src/api/resources/index.ts b/packages/sdk/src/api/resources/index.ts
index 6bb0eec50..95ddeaa69 100644
--- a/packages/sdk/src/api/resources/index.ts
+++ b/packages/sdk/src/api/resources/index.ts
@@ -1,4 +1,3 @@
-export * as legacy from "./legacy/index.js";
export * as mcpServers from "./mcpServers/index.js";
export * as models from "./models/index.js";
export * as server from "./server/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/client/Client.ts b/packages/sdk/src/api/resources/legacy/client/Client.ts
deleted file mode 100644
index 66633b8e6..000000000
--- a/packages/sdk/src/api/resources/legacy/client/Client.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type { BaseClientOptions } from "../../../../BaseClient.js";
-import { type NormalizedClientOptions, normalizeClientOptions } from "../../../../BaseClient.js";
-import { McpServersClient } from "../resources/mcpServers/client/Client.js";
-import { ModelsClient } from "../resources/models/client/Client.js";
-import { ServerClient } from "../resources/server/client/Client.js";
-import { SkillsClient } from "../resources/skills/client/Client.js";
-
-export declare namespace LegacyClient {
- export type Options = BaseClientOptions;
-}
-
-export class LegacyClient {
- protected readonly _options: NormalizedClientOptions<LegacyClient.Options>;
- protected _server: ServerClient | undefined;
- protected _mcpServers: McpServersClient | undefined;
- protected _models: ModelsClient | undefined;
- protected _skills: SkillsClient | undefined;
-
- constructor(options: LegacyClient.Options) {
- this._options = normalizeClientOptions(options);
- }
-
- public get server(): ServerClient {
- return (this._server ??= new ServerClient(this._options));
- }
-
- public get mcpServers(): McpServersClient {
- return (this._mcpServers ??= new McpServersClient(this._options));
- }
-
- public get models(): ModelsClient {
- return (this._models ??= new ModelsClient(this._options));
- }
-
- public get skills(): SkillsClient {
- return (this._skills ??= new SkillsClient(this._options));
- }
-}
diff --git a/packages/sdk/src/api/resources/legacy/client/index.ts b/packages/sdk/src/api/resources/legacy/client/index.ts
deleted file mode 100644
index cb0ff5c3b..000000000
--- a/packages/sdk/src/api/resources/legacy/client/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/packages/sdk/src/api/resources/legacy/exports.ts b/packages/sdk/src/api/resources/legacy/exports.ts
deleted file mode 100644
index 196c9b7a1..000000000
--- a/packages/sdk/src/api/resources/legacy/exports.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-export { LegacyClient } from "./client/Client.js";
-export * from "./client/index.js";
-export * from "./resources/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/index.ts b/packages/sdk/src/api/resources/legacy/index.ts
deleted file mode 100644
index 9eb1192dc..000000000
--- a/packages/sdk/src/api/resources/legacy/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "./client/index.js";
-export * from "./resources/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/resources/index.ts b/packages/sdk/src/api/resources/legacy/resources/index.ts
deleted file mode 100644
index 8b6053ca7..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export * as mcpServers from "./mcpServers/index.js";
-export * as models from "./models/index.js";
-export * as server from "./server/index.js";
-export * as skills from "./skills/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/resources/mcpServers/client/Client.ts b/packages/sdk/src/api/resources/legacy/resources/mcpServers/client/Client.ts
deleted file mode 100644
index 69973d07e..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/mcpServers/client/Client.ts
+++ /dev/null
@@ -1,191 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
-import { type NormalizedClientOptions, normalizeClientOptions } from "../../../../../../BaseClient.js";
-import { mergeHeaders } from "../../../../../../core/headers.js";
-import * as core from "../../../../../../core/index.js";
-import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-import * as errors from "../../../../../../errors/index.js";
-import * as serializers from "../../../../../../serialization/index.js";
-import * as TrueHarness from "../../../../../index.js";
-
-export declare namespace McpServersClient {
- export type Options = BaseClientOptions;
-
- export interface RequestOptions extends BaseRequestOptions {}
-}
-
-export class McpServersClient {
- protected readonly _options: NormalizedClientOptions<McpServersClient.Options>;
-
- constructor(options: McpServersClient.Options) {
- this._options = normalizeClientOptions(options);
- }
-
- /**
- * MCP servers declared in mcp.yaml, each with a passive auth_status snapshot. Auth headers are configured via env vars and never returned.
- *
- * @param {McpServersClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @throws {@link errors.TrueHarnessError}
- * @throws {@link errors.TrueHarnessTimeoutError}
- *
- * @example
- * await client.legacy.mcpServers.list()
- */
- public list(
- requestOptions?: McpServersClient.RequestOptions,
- ): core.HttpResponsePromise<TrueHarness.ListMcpServersResponse> {
- return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
- }
-
- private async __list(
- requestOptions?: McpServersClient.RequestOptions,
- ): Promise<core.WithRawResponse<TrueHarness.ListMcpServersResponse>> {
- const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers);
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: core.url.join(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "api/v1/legacy/mcp-servers",
- ),
- method: "GET",
- headers: _headers,
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- fetchFn: this._options?.fetch,
- logging: this._options.logging,
- });
- if (_response.ok) {
- return {
- data: serializers.ListMcpServersResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- }),
- rawResponse: _response.rawResponse,
- };
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.TrueHarnessError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- rawResponse: _response.rawResponse,
- });
- }
-
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/v1/legacy/mcp-servers");
- }
-
- /**
- * All tools exposed by the given MCP server (non-paginated), as returned by the MCP `tools/list` call. No agent-spec tool selectors are applied — this is the raw server catalog.
- *
- * @param {string} name - MCP server name from mcp.yaml.
- * @param {McpServersClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @throws {@link TrueHarness.UnauthorizedError}
- * @throws {@link TrueHarness.NotFoundError}
- * @throws {@link TrueHarness.BadGatewayError}
- * @throws {@link errors.TrueHarnessError}
- * @throws {@link errors.TrueHarnessTimeoutError}
- *
- * @example
- * await client.legacy.mcpServers.listTools("name")
- */
- public listTools(
- name: string,
- requestOptions?: McpServersClient.RequestOptions,
- ): core.HttpResponsePromise<TrueHarness.ListMcpToolsResponse> {
- return core.HttpResponsePromise.fromPromise(this.__listTools(name, requestOptions));
- }
-
- private async __listTools(
- name: string,
- requestOptions?: McpServersClient.RequestOptions,
- ): Promise<core.WithRawResponse<TrueHarness.ListMcpToolsResponse>> {
- const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers);
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: core.url.join(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- `api/v1/legacy/mcp-servers/${core.url.encodePathParam(name)}/tools`,
- ),
- method: "GET",
- headers: _headers,
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- fetchFn: this._options?.fetch,
- logging: this._options.logging,
- });
- if (_response.ok) {
- return {
- data: serializers.ListMcpToolsResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- }),
- rawResponse: _response.rawResponse,
- };
- }
-
- if (_response.error.reason === "status-code") {
- switch (_response.error.statusCode) {
- case 401:
- throw new TrueHarness.UnauthorizedError(
- serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- }),
- _response.rawResponse,
- );
- case 404:
- throw new TrueHarness.NotFoundError(
- serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- }),
- _response.rawResponse,
- );
- case 502:
- throw new TrueHarness.BadGatewayError(
- serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- }),
- _response.rawResponse,
- );
- default:
- throw new errors.TrueHarnessError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- return handleNonStatusCodeError(
- _response.error,
- _response.rawResponse,
- "GET",
- "/api/v1/legacy/mcp-servers/{name}/tools",
- );
- }
-}
diff --git a/packages/sdk/src/api/resources/legacy/resources/mcpServers/client/index.ts b/packages/sdk/src/api/resources/legacy/resources/mcpServers/client/index.ts
deleted file mode 100644
index cb0ff5c3b..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/mcpServers/client/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/packages/sdk/src/api/resources/legacy/resources/mcpServers/exports.ts b/packages/sdk/src/api/resources/legacy/resources/mcpServers/exports.ts
deleted file mode 100644
index 3a0df5f61..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/mcpServers/exports.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-export { McpServersClient } from "./client/Client.js";
-export * from "./client/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/resources/mcpServers/index.ts b/packages/sdk/src/api/resources/legacy/resources/mcpServers/index.ts
deleted file mode 100644
index 914b8c3c7..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/mcpServers/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./client/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/resources/models/client/Client.ts b/packages/sdk/src/api/resources/legacy/resources/models/client/Client.ts
deleted file mode 100644
index 5cdaf07c3..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/models/client/Client.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
-import { type NormalizedClientOptions, normalizeClientOptions } from "../../../../../../BaseClient.js";
-import { mergeHeaders } from "../../../../../../core/headers.js";
-import * as core from "../../../../../../core/index.js";
-import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-import * as errors from "../../../../../../errors/index.js";
-import * as serializers from "../../../../../../serialization/index.js";
-import type * as TrueHarness from "../../../../../index.js";
-
-export declare namespace ModelsClient {
- export type Options = BaseClientOptions;
-
- export interface RequestOptions extends BaseRequestOptions {}
-}
-
-export class ModelsClient {
- protected readonly _options: NormalizedClientOptions<ModelsClient.Options>;
-
- constructor(options: ModelsClient.Options) {
- this._options = normalizeClientOptions(options);
- }
-
- /**
- * Models declared in models.yaml — the registry the runtime still uses for turns.
- *
- * @param {ModelsClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @throws {@link errors.TrueHarnessError}
- * @throws {@link errors.TrueHarnessTimeoutError}
- *
- * @example
- * await client.legacy.models.list()
- */
- public list(
- requestOptions?: ModelsClient.RequestOptions,
- ): core.HttpResponsePromise<TrueHarness.ListLegacyModelsResponse> {
- return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
- }
-
- private async __list(
- requestOptions?: ModelsClient.RequestOptions,
- ): Promise<core.WithRawResponse<TrueHarness.ListLegacyModelsResponse>> {
- const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers);
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: core.url.join(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "api/v1/legacy/models",
- ),
- method: "GET",
- headers: _headers,
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- fetchFn: this._options?.fetch,
- logging: this._options.logging,
- });
- if (_response.ok) {
- return {
- data: serializers.ListLegacyModelsResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- }),
- rawResponse: _response.rawResponse,
- };
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.TrueHarnessError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- rawResponse: _response.rawResponse,
- });
- }
-
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/v1/legacy/models");
- }
-}
diff --git a/packages/sdk/src/api/resources/legacy/resources/models/client/index.ts b/packages/sdk/src/api/resources/legacy/resources/models/client/index.ts
deleted file mode 100644
index cb0ff5c3b..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/models/client/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/packages/sdk/src/api/resources/legacy/resources/models/exports.ts b/packages/sdk/src/api/resources/legacy/resources/models/exports.ts
deleted file mode 100644
index 32c5deac0..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/models/exports.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-export { ModelsClient } from "./client/Client.js";
-export * from "./client/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/resources/models/index.ts b/packages/sdk/src/api/resources/legacy/resources/models/index.ts
deleted file mode 100644
index 914b8c3c7..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/models/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./client/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/resources/server/client/Client.ts b/packages/sdk/src/api/resources/legacy/resources/server/client/Client.ts
deleted file mode 100644
index d3f28afb7..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/server/client/Client.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
-import { type NormalizedClientOptions, normalizeClientOptions } from "../../../../../../BaseClient.js";
-import { mergeHeaders } from "../../../../../../core/headers.js";
-import * as core from "../../../../../../core/index.js";
-import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-import * as errors from "../../../../../../errors/index.js";
-import * as serializers from "../../../../../../serialization/index.js";
-import type * as TrueHarness from "../../../../../index.js";
-
-export declare namespace ServerClient {
- export type Options = BaseClientOptions;
-
- export interface RequestOptions extends BaseRequestOptions {}
-}
-
-export class ServerClient {
- protected readonly _options: NormalizedClientOptions<ServerClient.Options>;
-
- constructor(options: ServerClient.Options) {
- this._options = normalizeClientOptions(options);
- }
-
- /**
- * Report optional runtime capabilities from boot-time SANDBOX_SETTINGS. Prefer GET /api/v1/capabilities for new clients.
- *
- * @param {ServerClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @throws {@link errors.TrueHarnessError}
- * @throws {@link errors.TrueHarnessTimeoutError}
- *
- * @example
- * await client.legacy.server.getCapabilities()
- */
- public getCapabilities(
- requestOptions?: ServerClient.RequestOptions,
- ): core.HttpResponsePromise<TrueHarness.GetLegacyCapabilitiesResponse> {
- return core.HttpResponsePromise.fromPromise(this.__getCapabilities(requestOptions));
- }
-
- private async __getCapabilities(
- requestOptions?: ServerClient.RequestOptions,
- ): Promise<core.WithRawResponse<TrueHarness.GetLegacyCapabilitiesResponse>> {
- const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers);
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: core.url.join(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "api/v1/legacy/capabilities",
- ),
- method: "GET",
- headers: _headers,
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- fetchFn: this._options?.fetch,
- logging: this._options.logging,
- });
- if (_response.ok) {
- return {
- data: serializers.GetLegacyCapabilitiesResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- }),
- rawResponse: _response.rawResponse,
- };
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.TrueHarnessError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- rawResponse: _response.rawResponse,
- });
- }
-
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/v1/legacy/capabilities");
- }
-}
diff --git a/packages/sdk/src/api/resources/legacy/resources/server/client/index.ts b/packages/sdk/src/api/resources/legacy/resources/server/client/index.ts
deleted file mode 100644
index cb0ff5c3b..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/server/client/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/packages/sdk/src/api/resources/legacy/resources/server/exports.ts b/packages/sdk/src/api/resources/legacy/resources/server/exports.ts
deleted file mode 100644
index 8f4a0a141..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/server/exports.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-export { ServerClient } from "./client/Client.js";
-export * from "./client/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/resources/server/index.ts b/packages/sdk/src/api/resources/legacy/resources/server/index.ts
deleted file mode 100644
index 914b8c3c7..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/server/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./client/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/resources/skills/client/Client.ts b/packages/sdk/src/api/resources/legacy/resources/skills/client/Client.ts
deleted file mode 100644
index 0361c5a0d..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/skills/client/Client.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
-import { type NormalizedClientOptions, normalizeClientOptions } from "../../../../../../BaseClient.js";
-import { mergeHeaders } from "../../../../../../core/headers.js";
-import * as core from "../../../../../../core/index.js";
-import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-import * as errors from "../../../../../../errors/index.js";
-import * as serializers from "../../../../../../serialization/index.js";
-import type * as TrueHarness from "../../../../../index.js";
-
-export declare namespace SkillsClient {
- export type Options = BaseClientOptions;
-
- export interface RequestOptions extends BaseRequestOptions {}
-}
-
-export class SkillsClient {
- protected readonly _options: NormalizedClientOptions<SkillsClient.Options>;
-
- constructor(options: SkillsClient.Options) {
- this._options = normalizeClientOptions(options);
- }
-
- /**
- * Agent skills declared in skills.yaml.
- *
- * @param {SkillsClient.RequestOptions} requestOptions - Request-specific configuration.
- *
- * @throws {@link errors.TrueHarnessError}
- * @throws {@link errors.TrueHarnessTimeoutError}
- *
- * @example
- * await client.legacy.skills.list()
- */
- public list(
- requestOptions?: SkillsClient.RequestOptions,
- ): core.HttpResponsePromise<TrueHarness.ListSkillsResponse> {
- return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
- }
-
- private async __list(
- requestOptions?: SkillsClient.RequestOptions,
- ): Promise<core.WithRawResponse<TrueHarness.ListSkillsResponse>> {
- const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers);
- const _response = await (this._options.fetcher ?? core.fetcher)({
- url: core.url.join(
- (await core.Supplier.get(this._options.baseUrl)) ??
- (await core.Supplier.get(this._options.environment)),
- "api/v1/legacy/skills",
- ),
- method: "GET",
- headers: _headers,
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
- abortSignal: requestOptions?.abortSignal,
- fetchFn: this._options?.fetch,
- logging: this._options.logging,
- });
- if (_response.ok) {
- return {
- data: serializers.ListSkillsResponse.parseOrThrow(_response.body, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- skipValidation: true,
- breadcrumbsPrefix: ["response"],
- }),
- rawResponse: _response.rawResponse,
- };
- }
-
- if (_response.error.reason === "status-code") {
- throw new errors.TrueHarnessError({
- statusCode: _response.error.statusCode,
- body: _response.error.body,
- rawResponse: _response.rawResponse,
- });
- }
-
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/v1/legacy/skills");
- }
-}
diff --git a/packages/sdk/src/api/resources/legacy/resources/skills/client/index.ts b/packages/sdk/src/api/resources/legacy/resources/skills/client/index.ts
deleted file mode 100644
index cb0ff5c3b..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/skills/client/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/packages/sdk/src/api/resources/legacy/resources/skills/exports.ts b/packages/sdk/src/api/resources/legacy/resources/skills/exports.ts
deleted file mode 100644
index b13b787d5..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/skills/exports.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-export { SkillsClient } from "./client/Client.js";
-export * from "./client/index.js";
diff --git a/packages/sdk/src/api/resources/legacy/resources/skills/index.ts b/packages/sdk/src/api/resources/legacy/resources/skills/index.ts
deleted file mode 100644
index 914b8c3c7..000000000
--- a/packages/sdk/src/api/resources/legacy/resources/skills/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./client/index.js";
diff --git a/packages/sdk/src/api/resources/settings/resources/skills/client/Client.ts b/packages/sdk/src/api/resources/settings/resources/skills/client/Client.ts
index 80da900a0..6a10558b6 100644
--- a/packages/sdk/src/api/resources/settings/resources/skills/client/Client.ts
+++ b/packages/sdk/src/api/resources/settings/resources/skills/client/Client.ts
@@ -97,6 +97,7 @@ export class SkillsClient {
* await client.settings.skills.upsert({
* description: "description",
* name: "name",
+ * ref: "ref",
* type: "git",
* url: "url"
* })
diff --git a/packages/sdk/src/api/types/AgentSpec.ts b/packages/sdk/src/api/types/AgentSpec.ts
index fba49eead..3a9734adb 100644
--- a/packages/sdk/src/api/types/AgentSpec.ts
+++ b/packages/sdk/src/api/types/AgentSpec.ts
@@ -12,6 +12,6 @@ export interface AgentSpec {
messages?: TrueHarness.AgentSpecUserMessage[];
model: TrueHarness.AgentSpecModel;
responseFormat?: TrueHarness.ResponseFormat;
- skills?: TrueHarness.SkillMount[];
+ skills?: TrueHarness.SkillNameRef[];
variables?: Record<string, string>;
}
diff --git a/packages/sdk/src/api/types/CatalogSkill.ts b/packages/sdk/src/api/types/CatalogSkill.ts
index 052460bff..ccd7ba4fc 100644
--- a/packages/sdk/src/api/types/CatalogSkill.ts
+++ b/packages/sdk/src/api/types/CatalogSkill.ts
@@ -9,7 +9,7 @@ export interface CatalogSkill {
/** Path to the skill directory within the repository. Omit to use the repository root. */
path?: string;
/** Git ref — branch name, tag, or commit SHA. */
- ref?: string;
+ ref: string;
type: TrueHarness.SkillType;
/** Full HTTPS URL of a GitHub or GitLab repository. */
url: string;
diff --git a/packages/sdk/src/api/types/GetLegacyCapabilitiesResponse.ts b/packages/sdk/src/api/types/GetLegacyCapabilitiesResponse.ts
deleted file mode 100644
index d7f11b94b..000000000
--- a/packages/sdk/src/api/types/GetLegacyCapabilitiesResponse.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../index.js";
-
-export interface GetLegacyCapabilitiesResponse {
- data: TrueHarness.GetLegacyCapabilitiesResponseData;
-}
diff --git a/packages/sdk/src/api/types/GetLegacyCapabilitiesResponseData.ts b/packages/sdk/src/api/types/GetLegacyCapabilitiesResponseData.ts
deleted file mode 100644
index 03ea027ac..000000000
--- a/packages/sdk/src/api/types/GetLegacyCapabilitiesResponseData.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../index.js";
-
-export interface GetLegacyCapabilitiesResponseData {
- sandbox: TrueHarness.GetLegacyCapabilitiesResponseDataSandbox;
-}
diff --git a/packages/sdk/src/api/types/GetLegacyCapabilitiesResponseDataSandbox.ts b/packages/sdk/src/api/types/GetLegacyCapabilitiesResponseDataSandbox.ts
deleted file mode 100644
index d7e93a79a..000000000
--- a/packages/sdk/src/api/types/GetLegacyCapabilitiesResponseDataSandbox.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-export interface GetLegacyCapabilitiesResponseDataSandbox {
- /** Whether this server has a sandbox provider configured via SANDBOX_SETTINGS. */
- enabled: boolean;
-}
diff --git a/packages/sdk/src/api/types/ListLegacyModelsResponse.ts b/packages/sdk/src/api/types/ListLegacyModelsResponse.ts
deleted file mode 100644
index 0ae6451bf..000000000
--- a/packages/sdk/src/api/types/ListLegacyModelsResponse.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../index.js";
-
-export interface ListLegacyModelsResponse {
- data: TrueHarness.ListLegacyModelsResponseDataItem[];
-}
diff --git a/packages/sdk/src/api/types/ListLegacyModelsResponseDataItem.ts b/packages/sdk/src/api/types/ListLegacyModelsResponseDataItem.ts
deleted file mode 100644
index 7fa2b4fed..000000000
--- a/packages/sdk/src/api/types/ListLegacyModelsResponseDataItem.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../index.js";
-
-export interface ListLegacyModelsResponseDataItem {
- apiKey?: string;
- baseUrl?: string;
- headers?: Record<string, string>;
- maxOutputTokens?: number;
- modelId?: string;
- name?: string;
- provider?: "openai";
- reasoningEfforts?: string[];
- apiFormat?: "openai-chat-completions";
- properties: TrueHarness.ModelProperties;
-}
diff --git a/packages/sdk/src/api/types/ListMcpServersResponse.ts b/packages/sdk/src/api/types/ListMcpServersResponse.ts
deleted file mode 100644
index ebcac5ade..000000000
--- a/packages/sdk/src/api/types/ListMcpServersResponse.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../index.js";
-
-export interface ListMcpServersResponse {
- data: TrueHarness.McpServerEntry[];
-}
diff --git a/packages/sdk/src/api/types/ListMcpToolsResponse.ts b/packages/sdk/src/api/types/ListMcpToolsResponse.ts
deleted file mode 100644
index c7dece6fb..000000000
--- a/packages/sdk/src/api/types/ListMcpToolsResponse.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-export interface ListMcpToolsResponse {
- /** MCP `tools/list` entries, passed through verbatim from the MCP server. */
- data: Record<string, unknown>[];
-}
diff --git a/packages/sdk/src/api/types/ListSkillsResponse.ts b/packages/sdk/src/api/types/ListSkillsResponse.ts
deleted file mode 100644
index d1d4f923a..000000000
--- a/packages/sdk/src/api/types/ListSkillsResponse.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../index.js";
-
-export interface ListSkillsResponse {
- data: TrueHarness.SkillEntry[];
-}
diff --git a/packages/sdk/src/api/types/McpServerAuthSettings.ts b/packages/sdk/src/api/types/McpServerAuthSettings.ts
deleted file mode 100644
index 8263d1c66..000000000
--- a/packages/sdk/src/api/types/McpServerAuthSettings.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-export interface McpServerAuthSettings {
- type: "dcr";
-}
diff --git a/packages/sdk/src/api/types/McpServerEntry.ts b/packages/sdk/src/api/types/McpServerEntry.ts
deleted file mode 100644
index 2d86436d2..000000000
--- a/packages/sdk/src/api/types/McpServerEntry.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../index.js";
-
-export interface McpServerEntry {
- auth?: TrueHarness.McpServerAuthSettings;
- /** Passive check only: whether a stored, unexpired token exists. Never attempts a live refresh, so an expired-but-refreshable token still reads as `authentication_required` here. `not_required` for servers without `auth` configured. */
- authStatus: TrueHarness.McpServerEntryAuthStatus;
- name: string;
- url: string;
-}
diff --git a/packages/sdk/src/api/types/McpServerEntryAuthStatus.ts b/packages/sdk/src/api/types/McpServerEntryAuthStatus.ts
deleted file mode 100644
index 0309ae0cf..000000000
--- a/packages/sdk/src/api/types/McpServerEntryAuthStatus.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-/** Passive check only: whether a stored, unexpired token exists. Never attempts a live refresh, so an expired-but-refreshable token still reads as `authentication_required` here. `not_required` for servers without `auth` configured. */
-export const McpServerEntryAuthStatus = {
- Authenticated: "authenticated",
- AuthenticationRequired: "authentication_required",
- NotRequired: "not_required",
-} as const;
-export type McpServerEntryAuthStatus = (typeof McpServerEntryAuthStatus)[keyof typeof McpServerEntryAuthStatus];
diff --git a/packages/sdk/src/api/types/SkillEntry.ts b/packages/sdk/src/api/types/SkillEntry.ts
deleted file mode 100644
index 7a158e7ef..000000000
--- a/packages/sdk/src/api/types/SkillEntry.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-export interface SkillEntry {
- description: string;
- name: string;
- path?: string;
- ref?: string;
- url: string;
-}
diff --git a/packages/sdk/src/api/types/SkillManifest.ts b/packages/sdk/src/api/types/SkillManifest.ts
index 49d8ba824..879b29188 100644
--- a/packages/sdk/src/api/types/SkillManifest.ts
+++ b/packages/sdk/src/api/types/SkillManifest.ts
@@ -9,7 +9,7 @@ export interface SkillManifest {
/** Path to the skill directory within the repository. Omit to use the repository root. */
path?: string;
/** Git ref — branch name, tag, or commit SHA. */
- ref?: string;
+ ref: string;
type: TrueHarness.SkillType;
/** Full HTTPS URL of a GitHub or GitLab repository. */
url: string;
diff --git a/packages/sdk/src/api/types/SkillMount.ts b/packages/sdk/src/api/types/SkillMount.ts
deleted file mode 100644
index ed3a6d5da..000000000
--- a/packages/sdk/src/api/types/SkillMount.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-export interface SkillMount {
- /** Concise guidance for when the agent should use the skill. */
- description: string;
- /** Name for the skill, used as directory name in sandbox. */
- name: string;
- /** Path to the skill directory within the repository. Omit to use the repository root. */
- path?: string;
- /** Git ref — branch name, tag, or commit SHA. */
- ref: string;
- type: "git";
- /** Full HTTPS URL of a GitHub or GitLab repository. */
- url: string;
-}
diff --git a/packages/sdk/src/api/types/SkillNameRef.ts b/packages/sdk/src/api/types/SkillNameRef.ts
new file mode 100644
index 000000000..26235394e
--- /dev/null
+++ b/packages/sdk/src/api/types/SkillNameRef.ts
@@ -0,0 +1,6 @@
+// This file was auto-generated by Fern from our API Definition.
+
+export interface SkillNameRef {
+ /** Name for the skill, used as directory name in sandbox. */
+ name: string;
+}
diff --git a/packages/sdk/src/api/types/index.ts b/packages/sdk/src/api/types/index.ts
index 7ce6ae09a..23a90e6c6 100644
--- a/packages/sdk/src/api/types/index.ts
+++ b/packages/sdk/src/api/types/index.ts
@@ -41,9 +41,6 @@ export * from "./GetCapabilitiesResponse.js";
export * from "./GetCapabilitiesResponseData.js";
export * from "./GetCapabilitiesResponseDataSandbox.js";
export * from "./GetCapabilitiesResponseDataSkill.js";
-export * from "./GetLegacyCapabilitiesResponse.js";
-export * from "./GetLegacyCapabilitiesResponseData.js";
-export * from "./GetLegacyCapabilitiesResponseDataSandbox.js";
export * from "./GetMcpServerCatalogResponse.js";
export * from "./GetModelProviderCatalogResponse.js";
export * from "./GetSandboxProviderCatalogResponse.js";
@@ -56,17 +53,12 @@ export * from "./ListAvailableMcpServersResponse.js";
export * from "./ListAvailableSkillsResponse.js";
export * from "./ListConfiguredMcpServersResponse.js";
export * from "./ListConfiguredSkillsResponse.js";
-export * from "./ListLegacyModelsResponse.js";
-export * from "./ListLegacyModelsResponseDataItem.js";
-export * from "./ListMcpServersResponse.js";
export * from "./ListMcpServerToolsResponse.js";
-export * from "./ListMcpToolsResponse.js";
export * from "./ListModelProvidersResponse.js";
export * from "./ListModelsResponse.js";
export * from "./ListSessionEventsResponse.js";
export * from "./ListSessionsOrder.js";
export * from "./ListSessionsResponse.js";
-export * from "./ListSkillsResponse.js";
export * from "./ListTurnEventsOrder.js";
export * from "./ListTurnEventsResponse.js";
export * from "./ListTurnsResponse.js";
@@ -76,12 +68,9 @@ export * from "./McpAuthStatusStatus.js";
export * from "./McpInitializeEvent.js";
export * from "./McpServer.js";
export * from "./McpServerAuthInfo.js";
-export * from "./McpServerAuthSettings.js";
export * from "./McpServerDcrAuth.js";
export * from "./McpServerDisableToolsItem.js";
export * from "./McpServerEnableToolsItem.js";
-export * from "./McpServerEntry.js";
-export * from "./McpServerEntryAuthStatus.js";
export * from "./McpServerHeaderAuth.js";
export * from "./McpServerInitInfo.js";
export * from "./McpServerInitInfoTransportType.js";
@@ -127,9 +116,8 @@ export * from "./SandboxNetworkPolicyAuthInjectItemMatch.js";
export * from "./Session.js";
export * from "./SessionEvent.js";
export * from "./SessionEventItem.js";
-export * from "./SkillEntry.js";
export * from "./SkillManifest.js";
-export * from "./SkillMount.js";
+export * from "./SkillNameRef.js";
export * from "./SkillReadEntry.js";
export * from "./SkillType.js";
export * from "./TextContent.js";
diff --git a/packages/sdk/src/serialization/types/AgentSpec.ts b/packages/sdk/src/serialization/types/AgentSpec.ts
index 076572b5a..037cd5000 100644
--- a/packages/sdk/src/serialization/types/AgentSpec.ts
+++ b/packages/sdk/src/serialization/types/AgentSpec.ts
@@ -8,7 +8,7 @@ import { AgentSpecUserMessage } from "./AgentSpecUserMessage.js";
import { McpServer } from "./McpServer.js";
import { ResponseFormat } from "./ResponseFormat.js";
import { RuntimeConfig } from "./RuntimeConfig.js";
-import { SkillMount } from "./SkillMount.js";
+import { SkillNameRef } from "./SkillNameRef.js";
export const AgentSpec: core.serialization.ObjectSchema<serializers.AgentSpec.Raw, TrueHarness.AgentSpec> =
core.serialization.object({
@@ -18,7 +18,7 @@ export const AgentSpec: core.serialization.ObjectSchema<serializers.AgentSpec.Ra
messages: core.serialization.list(AgentSpecUserMessage).optional(),
model: AgentSpecModel,
responseFormat: core.serialization.property("response_format", ResponseFormat.optional()),
- skills: core.serialization.list(SkillMount).optional(),
+ skills: core.serialization.list(SkillNameRef).optional(),
variables: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(),
});
@@ -30,7 +30,7 @@ export declare namespace AgentSpec {
messages?: AgentSpecUserMessage.Raw[] | null;
model: AgentSpecModel.Raw;
response_format?: ResponseFormat.Raw | null;
- skills?: SkillMount.Raw[] | null;
+ skills?: SkillNameRef.Raw[] | null;
variables?: Record<string, string> | null;
}
}
diff --git a/packages/sdk/src/serialization/types/CatalogSkill.ts b/packages/sdk/src/serialization/types/CatalogSkill.ts
index 94c6e39b7..fd74232fb 100644
--- a/packages/sdk/src/serialization/types/CatalogSkill.ts
+++ b/packages/sdk/src/serialization/types/CatalogSkill.ts
@@ -11,7 +11,7 @@ export const CatalogSkill: core.serialization.ObjectSchema<serializers.CatalogSk
description: core.serialization.string(),
name: ResourceName,
path: core.serialization.string().optional(),
- ref: core.serialization.string().optional(),
+ ref: core.serialization.string(),
type: SkillType,
url: core.serialization.string(),
});
@@ -21,7 +21,7 @@ export declare namespace CatalogSkill {
description: string;
name: ResourceName.Raw;
path?: string | null;
- ref?: string | null;
+ ref: string;
type: SkillType.Raw;
url: string;
}
diff --git a/packages/sdk/src/serialization/types/GetLegacyCapabilitiesResponse.ts b/packages/sdk/src/serialization/types/GetLegacyCapabilitiesResponse.ts
deleted file mode 100644
index fab9a9c44..000000000
--- a/packages/sdk/src/serialization/types/GetLegacyCapabilitiesResponse.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-import { GetLegacyCapabilitiesResponseData } from "./GetLegacyCapabilitiesResponseData.js";
-
-export const GetLegacyCapabilitiesResponse: core.serialization.ObjectSchema<
- serializers.GetLegacyCapabilitiesResponse.Raw,
- TrueHarness.GetLegacyCapabilitiesResponse
-> = core.serialization.object({
- data: GetLegacyCapabilitiesResponseData,
-});
-
-export declare namespace GetLegacyCapabilitiesResponse {
- export interface Raw {
- data: GetLegacyCapabilitiesResponseData.Raw;
- }
-}
diff --git a/packages/sdk/src/serialization/types/GetLegacyCapabilitiesResponseData.ts b/packages/sdk/src/serialization/types/GetLegacyCapabilitiesResponseData.ts
deleted file mode 100644
index a1f1dae91..000000000
--- a/packages/sdk/src/serialization/types/GetLegacyCapabilitiesResponseData.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-import { GetLegacyCapabilitiesResponseDataSandbox } from "./GetLegacyCapabilitiesResponseDataSandbox.js";
-
-export const GetLegacyCapabilitiesResponseData: core.serialization.ObjectSchema<
- serializers.GetLegacyCapabilitiesResponseData.Raw,
- TrueHarness.GetLegacyCapabilitiesResponseData
-> = core.serialization.object({
- sandbox: GetLegacyCapabilitiesResponseDataSandbox,
-});
-
-export declare namespace GetLegacyCapabilitiesResponseData {
- export interface Raw {
- sandbox: GetLegacyCapabilitiesResponseDataSandbox.Raw;
- }
-}
diff --git a/packages/sdk/src/serialization/types/GetLegacyCapabilitiesResponseDataSandbox.ts b/packages/sdk/src/serialization/types/GetLegacyCapabilitiesResponseDataSandbox.ts
deleted file mode 100644
index cc1208c23..000000000
--- a/packages/sdk/src/serialization/types/GetLegacyCapabilitiesResponseDataSandbox.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-
-export const GetLegacyCapabilitiesResponseDataSandbox: core.serialization.ObjectSchema<
- serializers.GetLegacyCapabilitiesResponseDataSandbox.Raw,
- TrueHarness.GetLegacyCapabilitiesResponseDataSandbox
-> = core.serialization.object({
- enabled: core.serialization.boolean(),
-});
-
-export declare namespace GetLegacyCapabilitiesResponseDataSandbox {
- export interface Raw {
- enabled: boolean;
- }
-}
diff --git a/packages/sdk/src/serialization/types/ListLegacyModelsResponse.ts b/packages/sdk/src/serialization/types/ListLegacyModelsResponse.ts
deleted file mode 100644
index 2981be32b..000000000
--- a/packages/sdk/src/serialization/types/ListLegacyModelsResponse.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-import { ListLegacyModelsResponseDataItem } from "./ListLegacyModelsResponseDataItem.js";
-
-export const ListLegacyModelsResponse: core.serialization.ObjectSchema<
- serializers.ListLegacyModelsResponse.Raw,
- TrueHarness.ListLegacyModelsResponse
-> = core.serialization.object({
- data: core.serialization.list(ListLegacyModelsResponseDataItem),
-});
-
-export declare namespace ListLegacyModelsResponse {
- export interface Raw {
- data: ListLegacyModelsResponseDataItem.Raw[];
- }
-}
diff --git a/packages/sdk/src/serialization/types/ListLegacyModelsResponseDataItem.ts b/packages/sdk/src/serialization/types/ListLegacyModelsResponseDataItem.ts
deleted file mode 100644
index 5347f8a4a..000000000
--- a/packages/sdk/src/serialization/types/ListLegacyModelsResponseDataItem.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-import { ModelProperties } from "./ModelProperties.js";
-
-export const ListLegacyModelsResponseDataItem: core.serialization.ObjectSchema<
- serializers.ListLegacyModelsResponseDataItem.Raw,
- TrueHarness.ListLegacyModelsResponseDataItem
-> = core.serialization.object({
- apiKey: core.serialization.property("api_key", core.serialization.string().optional()),
- baseUrl: core.serialization.property("base_url", core.serialization.string().optional()),
- headers: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(),
- maxOutputTokens: core.serialization.property("max_output_tokens", core.serialization.number().optional()),
- modelId: core.serialization.property("model_id", core.serialization.string().optional()),
- name: core.serialization.string().optional(),
- provider: core.serialization.stringLiteral("openai").optional(),
- reasoningEfforts: core.serialization.property(
- "reasoning_efforts",
- core.serialization.list(core.serialization.string()).optional(),
- ),
- apiFormat: core.serialization.property(
- "api_format",
- core.serialization.stringLiteral("openai-chat-completions").optional(),
- ),
- properties: ModelProperties,
-});
-
-export declare namespace ListLegacyModelsResponseDataItem {
- export interface Raw {
- api_key?: string | null;
- base_url?: string | null;
- headers?: Record<string, string> | null;
- max_output_tokens?: number | null;
- model_id?: string | null;
- name?: string | null;
- provider?: "openai" | null;
- reasoning_efforts?: string[] | null;
- api_format?: "openai-chat-completions" | null;
- properties: ModelProperties.Raw;
- }
-}
diff --git a/packages/sdk/src/serialization/types/ListMcpServersResponse.ts b/packages/sdk/src/serialization/types/ListMcpServersResponse.ts
deleted file mode 100644
index d14522406..000000000
--- a/packages/sdk/src/serialization/types/ListMcpServersResponse.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-import { McpServerEntry } from "./McpServerEntry.js";
-
-export const ListMcpServersResponse: core.serialization.ObjectSchema<
- serializers.ListMcpServersResponse.Raw,
- TrueHarness.ListMcpServersResponse
-> = core.serialization.object({
- data: core.serialization.list(McpServerEntry),
-});
-
-export declare namespace ListMcpServersResponse {
- export interface Raw {
- data: McpServerEntry.Raw[];
- }
-}
diff --git a/packages/sdk/src/serialization/types/ListMcpToolsResponse.ts b/packages/sdk/src/serialization/types/ListMcpToolsResponse.ts
deleted file mode 100644
index 30c624336..000000000
--- a/packages/sdk/src/serialization/types/ListMcpToolsResponse.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-
-export const ListMcpToolsResponse: core.serialization.ObjectSchema<
- serializers.ListMcpToolsResponse.Raw,
- TrueHarness.ListMcpToolsResponse
-> = core.serialization.object({
- data: core.serialization.list(core.serialization.record(core.serialization.string(), core.serialization.unknown())),
-});
-
-export declare namespace ListMcpToolsResponse {
- export interface Raw {
- data: Record<string, unknown>[];
- }
-}
diff --git a/packages/sdk/src/serialization/types/ListSkillsResponse.ts b/packages/sdk/src/serialization/types/ListSkillsResponse.ts
deleted file mode 100644
index be6ecb499..000000000
--- a/packages/sdk/src/serialization/types/ListSkillsResponse.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-import { SkillEntry } from "./SkillEntry.js";
-
-export const ListSkillsResponse: core.serialization.ObjectSchema<
- serializers.ListSkillsResponse.Raw,
- TrueHarness.ListSkillsResponse
-> = core.serialization.object({
- data: core.serialization.list(SkillEntry),
-});
-
-export declare namespace ListSkillsResponse {
- export interface Raw {
- data: SkillEntry.Raw[];
- }
-}
diff --git a/packages/sdk/src/serialization/types/McpServerAuthSettings.ts b/packages/sdk/src/serialization/types/McpServerAuthSettings.ts
deleted file mode 100644
index 0302c6d1d..000000000
--- a/packages/sdk/src/serialization/types/McpServerAuthSettings.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-
-export const McpServerAuthSettings: core.serialization.ObjectSchema<
- serializers.McpServerAuthSettings.Raw,
- TrueHarness.McpServerAuthSettings
-> = core.serialization.object({
- type: core.serialization.stringLiteral("dcr"),
-});
-
-export declare namespace McpServerAuthSettings {
- export interface Raw {
- type: "dcr";
- }
-}
diff --git a/packages/sdk/src/serialization/types/McpServerEntry.ts b/packages/sdk/src/serialization/types/McpServerEntry.ts
deleted file mode 100644
index 0ac096df3..000000000
--- a/packages/sdk/src/serialization/types/McpServerEntry.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-import { McpServerAuthSettings } from "./McpServerAuthSettings.js";
-import { McpServerEntryAuthStatus } from "./McpServerEntryAuthStatus.js";
-
-export const McpServerEntry: core.serialization.ObjectSchema<
- serializers.McpServerEntry.Raw,
- TrueHarness.McpServerEntry
-> = core.serialization.object({
- auth: McpServerAuthSettings.optional(),
- authStatus: core.serialization.property("auth_status", McpServerEntryAuthStatus),
- name: core.serialization.string(),
- url: core.serialization.string(),
-});
-
-export declare namespace McpServerEntry {
- export interface Raw {
- auth?: McpServerAuthSettings.Raw | null;
- auth_status: McpServerEntryAuthStatus.Raw;
- name: string;
- url: string;
- }
-}
diff --git a/packages/sdk/src/serialization/types/McpServerEntryAuthStatus.ts b/packages/sdk/src/serialization/types/McpServerEntryAuthStatus.ts
deleted file mode 100644
index 0e44d3065..000000000
--- a/packages/sdk/src/serialization/types/McpServerEntryAuthStatus.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-
-export const McpServerEntryAuthStatus: core.serialization.Schema<
- serializers.McpServerEntryAuthStatus.Raw,
- TrueHarness.McpServerEntryAuthStatus
-> = core.serialization.enum_(["authenticated", "authentication_required", "not_required"]);
-
-export declare namespace McpServerEntryAuthStatus {
- export type Raw = "authenticated" | "authentication_required" | "not_required";
-}
diff --git a/packages/sdk/src/serialization/types/SkillEntry.ts b/packages/sdk/src/serialization/types/SkillEntry.ts
deleted file mode 100644
index ebb1ca565..000000000
--- a/packages/sdk/src/serialization/types/SkillEntry.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-
-export const SkillEntry: core.serialization.ObjectSchema<serializers.SkillEntry.Raw, TrueHarness.SkillEntry> =
- core.serialization.object({
- description: core.serialization.string(),
- name: core.serialization.string(),
- path: core.serialization.string().optional(),
- ref: core.serialization.string().optional(),
- url: core.serialization.string(),
- });
-
-export declare namespace SkillEntry {
- export interface Raw {
- description: string;
- name: string;
- path?: string | null;
- ref?: string | null;
- url: string;
- }
-}
diff --git a/packages/sdk/src/serialization/types/SkillManifest.ts b/packages/sdk/src/serialization/types/SkillManifest.ts
index 662bb39d4..50227786c 100644
--- a/packages/sdk/src/serialization/types/SkillManifest.ts
+++ b/packages/sdk/src/serialization/types/SkillManifest.ts
@@ -11,7 +11,7 @@ export const SkillManifest: core.serialization.ObjectSchema<serializers.SkillMan
description: core.serialization.string(),
name: ResourceName,
path: core.serialization.string().optional(),
- ref: core.serialization.string().optional(),
+ ref: core.serialization.string(),
type: SkillType,
url: core.serialization.string(),
});
@@ -21,7 +21,7 @@ export declare namespace SkillManifest {
description: string;
name: ResourceName.Raw;
path?: string | null;
- ref?: string | null;
+ ref: string;
type: SkillType.Raw;
url: string;
}
diff --git a/packages/sdk/src/serialization/types/SkillMount.ts b/packages/sdk/src/serialization/types/SkillMount.ts
deleted file mode 100644
index 625b0aa8f..000000000
--- a/packages/sdk/src/serialization/types/SkillMount.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import type * as TrueHarness from "../../api/index.js";
-import * as core from "../../core/index.js";
-import type * as serializers from "../index.js";
-
-export const SkillMount: core.serialization.ObjectSchema<serializers.SkillMount.Raw, TrueHarness.SkillMount> =
- core.serialization.object({
- description: core.serialization.string(),
- name: core.serialization.string(),
- path: core.serialization.string().optional(),
- ref: core.serialization.string(),
- type: core.serialization.stringLiteral("git"),
- url: core.serialization.string(),
- });
-
-export declare namespace SkillMount {
- export interface Raw {
- description: string;
- name: string;
- path?: string | null;
- ref: string;
- type: "git";
- url: string;
- }
-}
diff --git a/packages/sdk/src/serialization/types/SkillNameRef.ts b/packages/sdk/src/serialization/types/SkillNameRef.ts
new file mode 100644
index 000000000..186ff5463
--- /dev/null
+++ b/packages/sdk/src/serialization/types/SkillNameRef.ts
@@ -0,0 +1,16 @@
+// This file was auto-generated by Fern from our API Definition.
+
+import type * as TrueHarness from "../../api/index.js";
+import * as core from "../../core/index.js";
+import type * as serializers from "../index.js";
+
+export const SkillNameRef: core.serialization.ObjectSchema<serializers.SkillNameRef.Raw, TrueHarness.SkillNameRef> =
+ core.serialization.object({
+ name: core.serialization.string(),
+ });
+
+export declare namespace SkillNameRef {
+ export interface Raw {
+ name: string;
+ }
+}
diff --git a/packages/sdk/src/serialization/types/index.ts b/packages/sdk/src/serialization/types/index.ts
index 7ce6ae09a..23a90e6c6 100644
--- a/packages/sdk/src/serialization/types/index.ts
+++ b/packages/sdk/src/serialization/types/index.ts
@@ -41,9 +41,6 @@ export * from "./GetCapabilitiesResponse.js";
export * from "./GetCapabilitiesResponseData.js";
export * from "./GetCapabilitiesResponseDataSandbox.js";
export * from "./GetCapabilitiesResponseDataSkill.js";
-export * from "./GetLegacyCapabilitiesResponse.js";
-export * from "./GetLegacyCapabilitiesResponseData.js";
-export * from "./GetLegacyCapabilitiesResponseDataSandbox.js";
export * from "./GetMcpServerCatalogResponse.js";
export * from "./GetModelProviderCatalogResponse.js";
export * from "./GetSandboxProviderCatalogResponse.js";
@@ -56,17 +53,12 @@ export * from "./ListAvailableMcpServersResponse.js";
export * from "./ListAvailableSkillsResponse.js";
export * from "./ListConfiguredMcpServersResponse.js";
export * from "./ListConfiguredSkillsResponse.js";
-export * from "./ListLegacyModelsResponse.js";
-export * from "./ListLegacyModelsResponseDataItem.js";
-export * from "./ListMcpServersResponse.js";
export * from "./ListMcpServerToolsResponse.js";
-export * from "./ListMcpToolsResponse.js";
export * from "./ListModelProvidersResponse.js";
export * from "./ListModelsResponse.js";
export * from "./ListSessionEventsResponse.js";
export * from "./ListSessionsOrder.js";
export * from "./ListSessionsResponse.js";
-export * from "./ListSkillsResponse.js";
export * from "./ListTurnEventsOrder.js";
export * from "./ListTurnEventsResponse.js";
export * from "./ListTurnsResponse.js";
@@ -76,12 +68,9 @@ export * from "./McpAuthStatusStatus.js";
export * from "./McpInitializeEvent.js";
export * from "./McpServer.js";
export * from "./McpServerAuthInfo.js";
-export * from "./McpServerAuthSettings.js";
export * from "./McpServerDcrAuth.js";
export * from "./McpServerDisableToolsItem.js";
export * from "./McpServerEnableToolsItem.js";
-export * from "./McpServerEntry.js";
-export * from "./McpServerEntryAuthStatus.js";
export * from "./McpServerHeaderAuth.js";
export * from "./McpServerInitInfo.js";
export * from "./McpServerInitInfoTransportType.js";
@@ -127,9 +116,8 @@ export * from "./SandboxNetworkPolicyAuthInjectItemMatch.js";
export * from "./Session.js";
export * from "./SessionEvent.js";
export * from "./SessionEventItem.js";
-export * from "./SkillEntry.js";
export * from "./SkillManifest.js";
-export * from "./SkillMount.js";
+export * from "./SkillNameRef.js";
export * from "./SkillReadEntry.js";
export * from "./SkillType.js";
export * from "./TextContent.js";
diff --git a/packages/sdk/tests/wire/legacy/mcpServers.test.ts b/packages/sdk/tests/wire/legacy/mcpServers.test.ts
deleted file mode 100644
index 731d40d33..000000000
--- a/packages/sdk/tests/wire/legacy/mcpServers.test.ts
+++ /dev/null
@@ -1,119 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import * as TrueHarnessTypes from "../../../src/api/index";
-import { TrueHarness } from "../../../src/Client";
-import { mockServerPool } from "../../mock-server/MockServerPool";
-
-describe("McpServersClient", () => {
- test("list", async () => {
- const server = mockServerPool.createServer();
- const client = new TrueHarness({ maxRetries: 0, environment: server.baseUrl });
-
- const rawResponseBody = {
- data: [{ auth: { type: "dcr" }, auth_status: "authenticated", name: "name", url: "url" }],
- };
-
- server
- .mockEndpoint()
- .get("/api/v1/legacy/mcp-servers")
- .respondWith()
- .statusCode(200)
- .jsonBody(rawResponseBody)
- .build();
-
- const response = await client.legacy.mcpServers.list();
- expect(response).toEqual({
- data: [
- {
- auth: {
- type: "dcr",
- },
- authStatus: "authenticated",
- name: "name",
- url: "url",
- },
- ],
- });
- });
-
- test("list_tools (1)", async () => {
- const server = mockServerPool.createServer();
- const client = new TrueHarness({ maxRetries: 0, environment: server.baseUrl });
-
- const rawResponseBody = { data: [{ key: "value" }] };
-
- server
- .mockEndpoint()
- .get("/api/v1/legacy/mcp-servers/name/tools")
- .respondWith()
- .statusCode(200)
- .jsonBody(rawResponseBody)
- .build();
-
- const response = await client.legacy.mcpServers.listTools("name");
- expect(response).toEqual({
- data: [
- {
- key: "value",
- },
- ],
- });
- });
-
- test("list_tools (2)", async () => {
- const server = mockServerPool.createServer();
- const client = new TrueHarness({ maxRetries: 0, environment: server.baseUrl });
-
- const rawResponseBody = { error: { message: "message" } };
-
- server
- .mockEndpoint()
- .get("/api/v1/legacy/mcp-servers/name/tools")
- .respondWith()
- .statusCode(401)
- .jsonBody(rawResponseBody)
- .build();
-
- await expect(async () => {
- return await client.legacy.mcpServers.listTools("name");
- }).rejects.toThrow(TrueHarnessTypes.UnauthorizedError);
- });
-
- test("list_tools (3)", async () => {
- const server = mockServerPool.createServer();
- const client = new TrueHarness({ maxRetries: 0, environment: server.baseUrl });
-
- const rawResponseBody = { error: { message: "message" } };
-
- server
- .mockEndpoint()
- .get("/api/v1/legacy/mcp-servers/name/tools")
- .respondWith()
- .statusCode(404)
- .jsonBody(rawResponseBody)
- .build();
-
- await expect(async () => {
- return await client.legacy.mcpServers.listTools("name");
- }).rejects.toThrow(TrueHarnessTypes.NotFoundError);
- });
-
- test("list_tools (4)", async () => {
- const server = mockServerPool.createServer();
- const client = new TrueHarness({ maxRetries: 0, environment: server.baseUrl });
-
- const rawResponseBody = { error: { message: "message" } };
-
- server
- .mockEndpoint()
- .get("/api/v1/legacy/mcp-servers/name/tools")
- .respondWith()
- .statusCode(502)
- .jsonBody(rawResponseBody)
- .build();
-
- await expect(async () => {
- return await client.legacy.mcpServers.listTools("name");
- }).rejects.toThrow(TrueHarnessTypes.BadGatewayError);
- });
-});
diff --git a/packages/sdk/tests/wire/legacy/models.test.ts b/packages/sdk/tests/wire/legacy/models.test.ts
deleted file mode 100644
index e4ecbb10e..000000000
--- a/packages/sdk/tests/wire/legacy/models.test.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import { TrueHarness } from "../../../src/Client";
-import { mockServerPool } from "../../mock-server/MockServerPool";
-
-describe("ModelsClient", () => {
- test("list", async () => {
- const server = mockServerPool.createServer();
- const client = new TrueHarness({ maxRetries: 0, environment: server.baseUrl });
-
- const rawResponseBody = {
- data: [
- {
- model_id: "model_id",
- name: "name",
- properties: { context_length: 1, max_output_tokens: 1 },
- api_key: "api_key",
- base_url: "base_url",
- headers: { key: "value" },
- max_output_tokens: 1,
- provider: "openai",
- reasoning_efforts: ["reasoning_efforts"],
- api_format: "openai-chat-completions",
- },
- ],
- };
-
- server
- .mockEndpoint()
- .get("/api/v1/legacy/models")
- .respondWith()
- .statusCode(200)
- .jsonBody(rawResponseBody)
- .build();
-
- const response = await client.legacy.models.list();
- expect(response).toEqual({
- data: [
- {
- modelId: "model_id",
- name: "name",
- properties: {
- contextLength: 1,
- maxOutputTokens: 1,
- },
- apiKey: "api_key",
- baseUrl: "base_url",
- headers: {
- key: "value",
- },
- maxOutputTokens: 1,
- provider: "openai",
- reasoningEfforts: ["reasoning_efforts"],
- apiFormat: "openai-chat-completions",
- },
- ],
- });
- });
-});
diff --git a/packages/sdk/tests/wire/legacy/server.test.ts b/packages/sdk/tests/wire/legacy/server.test.ts
deleted file mode 100644
index 5bad7c839..000000000
--- a/packages/sdk/tests/wire/legacy/server.test.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import { TrueHarness } from "../../../src/Client";
-import { mockServerPool } from "../../mock-server/MockServerPool";
-
-describe("ServerClient", () => {
- test("get_capabilities", async () => {
- const server = mockServerPool.createServer();
- const client = new TrueHarness({ maxRetries: 0, environment: server.baseUrl });
-
- const rawResponseBody = { data: { sandbox: { enabled: true } } };
-
- server
- .mockEndpoint()
- .get("/api/v1/legacy/capabilities")
- .respondWith()
- .statusCode(200)
- .jsonBody(rawResponseBody)
- .build();
-
- const response = await client.legacy.server.getCapabilities();
- expect(response).toEqual({
- data: {
- sandbox: {
- enabled: true,
- },
- },
- });
- });
-});
diff --git a/packages/sdk/tests/wire/legacy/skills.test.ts b/packages/sdk/tests/wire/legacy/skills.test.ts
deleted file mode 100644
index 0a37d4513..000000000
--- a/packages/sdk/tests/wire/legacy/skills.test.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-import { TrueHarness } from "../../../src/Client";
-import { mockServerPool } from "../../mock-server/MockServerPool";
-
-describe("SkillsClient", () => {
- test("list", async () => {
- const server = mockServerPool.createServer();
- const client = new TrueHarness({ maxRetries: 0, environment: server.baseUrl });
-
- const rawResponseBody = {
- data: [{ description: "description", name: "name", path: "path", ref: "ref", url: "url" }],
- };
-
- server
- .mockEndpoint()
- .get("/api/v1/legacy/skills")
- .respondWith()
- .statusCode(200)
- .jsonBody(rawResponseBody)
- .build();
-
- const response = await client.legacy.skills.list();
- expect(response).toEqual({
- data: [
- {
- description: "description",
- name: "name",
- path: "path",
- ref: "ref",
- url: "url",
- },
- ],
- });
- });
-});
diff --git a/packages/sdk/tests/wire/sessions.test.ts b/packages/sdk/tests/wire/sessions.test.ts
index 84a67f95a..e96f37588 100644
--- a/packages/sdk/tests/wire/sessions.test.ts
+++ b/packages/sdk/tests/wire/sessions.test.ts
@@ -102,7 +102,7 @@ describe("SessionsClient", () => {
properties: { context_length: 1, max_output_tokens: 1 },
},
response_format: { type: "json_object" },
- skills: [{ description: "description", name: "name", ref: "ref", type: "git", url: "url" }],
+ skills: [{ name: "name" }],
variables: { key: "value" },
},
created_at: "created_at",
@@ -161,11 +161,7 @@ describe("SessionsClient", () => {
},
skills: [
{
- description: "description",
name: "name",
- ref: "ref",
- type: "git",
- url: "url",
},
],
variables: {
@@ -266,7 +262,7 @@ describe("SessionsClient", () => {
properties: { context_length: 1, max_output_tokens: 1 },
},
response_format: { type: "json_object" },
- skills: [{ description: "description", name: "name", ref: "ref", type: "git", url: "url" }],
+ skills: [{ name: "name" }],
variables: { key: "value" },
},
created_at: "created_at",
@@ -313,11 +309,7 @@ describe("SessionsClient", () => {
},
skills: [
{
- description: "description",
name: "name",
- ref: "ref",
- type: "git",
- url: "url",
},
],
variables: {
@@ -377,7 +369,7 @@ describe("SessionsClient", () => {
properties: { context_length: 1, max_output_tokens: 1 },
},
response_format: { type: "json_object" },
- skills: [{ description: "description", name: "name", ref: "ref", type: "git", url: "url" }],
+ skills: [{ name: "name" }],
variables: { key: "value" },
},
created_at: "created_at",
@@ -425,11 +417,7 @@ describe("SessionsClient", () => {
},
skills: [
{
- description: "description",
name: "name",
- ref: "ref",
- type: "git",
- url: "url",
},
],
variables: {
diff --git a/packages/sdk/tests/wire/settings/skills.test.ts b/packages/sdk/tests/wire/settings/skills.test.ts
index 6ae7cc40c..ccc537b85 100644
--- a/packages/sdk/tests/wire/settings/skills.test.ts
+++ b/packages/sdk/tests/wire/settings/skills.test.ts
@@ -39,7 +39,7 @@ describe("SkillsClient", () => {
test("upsert (1)", async () => {
const server = mockServerPool.createServer();
const client = new TrueHarness({ maxRetries: 0, environment: server.baseUrl });
- const rawRequestBody = { description: "description", name: "name", type: "git", url: "url" };
+ const rawRequestBody = { description: "description", name: "name", ref: "ref", type: "git", url: "url" };
const rawResponseBody = {
data: { description: "description", name: "name", path: "path", ref: "ref", type: "git", url: "url" },
};
@@ -56,6 +56,7 @@ describe("SkillsClient", () => {
const response = await client.settings.skills.upsert({
description: "description",
name: "name",
+ ref: "ref",
type: "git",
url: "url",
});
@@ -74,7 +75,7 @@ describe("SkillsClient", () => {
test("upsert (2)", async () => {
const server = mockServerPool.createServer();
const client = new TrueHarness({ maxRetries: 0, environment: server.baseUrl });
- const rawRequestBody = { description: "x", name: "xy", type: "git", url: "x" };
+ const rawRequestBody = { description: "x", name: "xy", ref: "x", type: "git", url: "x" };
const rawResponseBody = { error: { message: "message" } };
server
@@ -90,6 +91,7 @@ describe("SkillsClient", () => {
return await client.settings.skills.upsert({
description: "x",
name: "xy",
+ ref: "x",
type: "git",
url: "x",
});
diff --git a/packages/server/.env.example b/packages/server/.env.example
index ffd0ffe0c..9f121e605 100644
--- a/packages/server/.env.example
+++ b/packages/server/.env.example
@@ -8,12 +8,6 @@
# HTTP port the server listens on. Optional, defaults to 8790.
PORT=8790
-# Directory containing the YAML config files (models.yaml, mcp.yaml,
-# skills.yaml). Optional, defaults to ./registry; relative paths are resolved
-# against the working directory. The model API base URL is the base_url field
-# in models.yaml; only its API key lives here.
-# REGISTRY_DIR=registry
-
# Optional override for the model catalog YAML (GET /settings/model-providers/catalog).
# When unset, the catalog inlined at build time (src/catalog/model-catalog.yaml) is used.
# MODEL_CATALOG_PATH=/path/to/model-catalog.yaml
@@ -56,32 +50,6 @@ REDIS_URL=redis://localhost:6379
# A subscribe request stays open for 10 minutes by default.
# TURN_SUBSCRIBE_TIMEOUT_MS=600000
-# Required. Default API key for the OpenAI-compatible API at models.yaml's
-# base_url, sent as "Authorization: Bearer <key>" on every model request.
-# Per-model overrides use MODEL_{NAME}_API_KEY with the same {NAME} rules as
-# MODEL_{NAME}_HEADERS below.
-MODEL_API_KEY=<your-api-key>
-# MODEL_OPENAI_MAIN_GPT_5_API_KEY=<gpt-5-specific-key>
-
-# ---------------------------------------------------------------------------
-# Extra model headers (JSON objects of string values). Optional.
-#
-# MODEL_HEADERS is added to every model request. Per-model overrides use
-# MODEL_{NAME}_HEADERS, where {NAME} is the model name from models.yaml,
-# uppercased with every run of non-alphanumeric characters replaced by "_".
-# Example: model "openai-main/gpt-5" -> MODEL_OPENAI_MAIN_GPT_5_HEADERS
-# ---------------------------------------------------------------------------
-# MODEL_HEADERS={"x-custom-header":"value"}
-# MODEL_OPENAI_MAIN_GPT_5_HEADERS={"x-custom-header":"gpt-5-specific-value"}
-
-# ---------------------------------------------------------------------------
-# MCP server auth headers. Same rules as model headers: MCP_HEADERS applies to
-# every MCP server in mcp.yaml; MCP_{NAME}_HEADERS overrides per server.
-# Example: MCP server "github" -> MCP_GITHUB_HEADERS
-# ---------------------------------------------------------------------------
-# MCP_HEADERS={"Authorization":"Bearer <mcp-token>"}
-# MCP_GITHUB_HEADERS={"Authorization":"Bearer <github-mcp-token>"}
-
# ---------------------------------------------------------------------------
# MCP OAuth (DCR). PUBLIC_BASE_URL is required — origin of the fixed callback route
# {PUBLIC_BASE_URL}/api/v1/mcp-servers/oauth/callback (not trimmed). OAUTH_CLIENT_NAME is
diff --git a/packages/server/.env.test b/packages/server/.env.test
index 1b4b253c3..442731292 100644
--- a/packages/server/.env.test
+++ b/packages/server/.env.test
@@ -4,7 +4,5 @@ POSTGRES_PASSWORD=test
POSTGRES_DB=test
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
-MODEL_API_KEY=test
-REGISTRY_DIR=registry-example
PUBLIC_BASE_URL=https://harness.example.com
OAUTH_CLIENT_NAME=truefoundry-harness
diff --git a/packages/server/registry-example/mcp.yaml b/packages/server/registry-example/mcp.yaml
deleted file mode 100644
index fbd8978d1..000000000
--- a/packages/server/registry-example/mcp.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-# MCP servers available to agents.
-#
-# Auth headers are configured via env vars, never in this file:
-# MCP_HEADERS - default headers for every MCP server
-# MCP_{NAME}_HEADERS - per-server overrides ({NAME} = server name,
-# uppercased, non-alphanumerics replaced by "_")
-mcp_servers:
- - name: github-remote
- # TODO(oss): replace internal endpoint with a placeholder before the repo
- # goes public.
- url: https://internal.devtest.truefoundry.tech/api/llm/truefoundry/mcp/github-remote/server
- # Optional `auth` field.
- # auth:
- # type: dcr
diff --git a/packages/server/registry-example/models.yaml b/packages/server/registry-example/models.yaml
deleted file mode 100644
index 6212edfb9..000000000
--- a/packages/server/registry-example/models.yaml
+++ /dev/null
@@ -1,88 +0,0 @@
-# Each model declares its own provider so direct vendors and gateways can be
-# mixed freely in the same registry.
-#
-# name — display name / alias used in the API and env var lookups.
-# Must be lowercase a-z, 0-9, hyphens, and dots (e.g. "gpt-4o").
-# model_id — the identifier sent to the provider (e.g. "anthropic/claude-sonnet-4-6"
-# for a gateway). Omit when name already matches the provider's model ID.
-#
-# Auth — two ways to configure credentials (first match wins per model):
-#
-# 1. Inline api_key / headers in this file using ${ENV_VAR} substitution:
-# api_key: "${ANTHROPIC_API_KEY}"
-# headers:
-# Authorization: "Bearer ${MY_TOKEN}"
-# The server resolves the env var at startup. Missing vars raise an error.
-#
-# 2. Env var conventions (fallback when api_key is absent):
-# MODEL_API_KEY — global default key for all models
-# MODEL_{NAME}_API_KEY — per-model override (keyed by name, not model_id)
-# MODEL_HEADERS — global extra headers
-# MODEL_{NAME}_HEADERS — per-model header overrides (keyed by name)
-# ({NAME} = name uppercased, non-alphanumerics → "_")
-#
-# Supported providers:
-# First-party (Vercel AI SDK): openai | anthropic | google-gemini
-# Custom (requires base_url): custom
-#
-# base_url is optional for first-party providers (overrides the default endpoint)
-# and required for the custom provider.
-#
-# api_format selects the API surface for the custom provider:
-# openai-chat-completions - OpenAI Chat Completions API (default).
-#
-# openai always uses the Responses API (supports o-series reasoning models,
-# store: false, and stateless multi-turn via reasoning.encrypted_content).
-
-models:
- # --- Direct Anthropic ---
- - name: claude-sonnet-4-6
- provider: anthropic
- api_key: '${ANTHROPIC_API_KEY}'
- max_output_tokens: 32768
- reasoning_efforts:
- - low
- - medium
- - high
-
- # --- Direct OpenAI (Responses API) ---
- - name: gpt-4o
- provider: openai
- api_key: '${OPENAI_API_KEY}'
- max_output_tokens: 16384
-
- - name: o4-mini
- provider: openai
- api_key: '${OPENAI_API_KEY}'
- max_output_tokens: 32768
- reasoning_efforts:
- - low
- - medium
- - high
-
- - name: o3
- provider: openai
- api_key: '${OPENAI_API_KEY}'
- max_output_tokens: 32768
- reasoning_efforts:
- - low
- - medium
- - high
-
- # --- Direct Google ---
- - name: gemini-2.5-flash
- provider: google-gemini
- api_key: '${GOOGLE_GEMINI_API_KEY}'
- max_output_tokens: 8192
-
- # --- Custom gateway (e.g. LiteLLM / TrueFoundry / any OpenAI-compat proxy) ---
- - name: claude-sonnet-4-6-gateway
- model_id: anthropic/claude-sonnet-4-6
- provider: custom
- api_key: '${LLM_GATEWAY_API_KEY}'
- base_url: https://your-gateway.example.com/api/llm
- max_output_tokens: 32768
- reasoning_efforts:
- - low
- - medium
- - high
diff --git a/packages/server/registry-example/skills.yaml b/packages/server/registry-example/skills.yaml
deleted file mode 100644
index b034051ff..000000000
--- a/packages/server/registry-example/skills.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-# Agent skills, each a directory with a SKILL.md in a public git repository.
-# url - public git repository
-# path - directory containing SKILL.md (optional, repo root if omitted)
-# ref - branch, tag, or commit SHA to pin (optional, default branch if omitted)
-# description - concise guidance for when to use the skill
-skills:
- - name: algorithmic-art
- url: https://github.com/anthropics/skills
- path: skills/algorithmic-art
- ref: main
- description: Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration.
diff --git a/packages/server/scripts/write-openapi.ts b/packages/server/scripts/write-openapi.ts
index 82b02c3c1..563d9fcc9 100644
--- a/packages/server/scripts/write-openapi.ts
+++ b/packages/server/scripts/write-openapi.ts
@@ -3,7 +3,7 @@
*
* The real app is built in-process and asked for its document, so the committed
* spec cannot drift from what the server serves. Nothing listens or dials out:
- * `.env.test` supplies dummy connection strings and the registry fixtures.
+ * `.env.test` supplies dummy connection strings.
*/
import type { TurnStreamingEvent } from '@truefoundry/utils-core/agent-session';
import { InMemorySessionStore, Sessions } from '@truefoundry/utils-core/agent-session';
@@ -22,9 +22,6 @@ import { SqliteModelProviderStore } from '../src/db/sqlite/model-provider-store/
import { SqliteSandboxProviderStore } from '../src/db/sqlite/sandbox-provider-store/SqliteSandboxProviderStore';
import { SqliteSkillStore } from '../src/db/sqlite/skill-store/SqliteSkillStore';
import { SqliteOAuthTokenStore } from '../src/db/sqlite/token-store/SqliteOAuthTokenStore';
-import { McpStore } from '../src/legacy-registry-store/McpStore';
-import { ModelStore } from '../src/legacy-registry-store/ModelStore';
-import { SkillStore } from '../src/legacy-registry-store/SkillStore';
import { ActiveTurnRegistry } from '../src/runtime/activeTurns';
import { EventSubscriptionRegistry } from '../src/runtime/event-subscription';
@@ -51,18 +48,15 @@ function canonicalise(value: unknown): unknown {
const sessionStore = new InMemorySessionStore();
const db = createSqliteDb(':memory:');
const app = createServerApp({
- modelStore: ModelStore.load(),
modelCatalog: ModelCatalog.load(),
modelProviderStore: new SqliteModelProviderStore(db),
mcpCatalog: McpCatalog.load(),
mcpServerStore: new SqliteMcpServerStore(db),
tokenStore: new SqliteOAuthTokenStore(db),
- mcpStore: McpStore.load(),
skillCatalog: SkillCatalog.load(),
skillStore: new SqliteSkillStore(db),
sandboxCatalog: SandboxCatalog.load(),
sandboxProviderStore: new SqliteSandboxProviderStore(db),
- legacySkillStore: SkillStore.load(),
sessionStore,
sessions: new Sessions({ sessionStore }),
activeTurns: new ActiveTurnRegistry(),
diff --git a/packages/server/src/apis/legacyCapabilities.ts b/packages/server/src/apis/legacyCapabilities.ts
deleted file mode 100644
index 50a4f4434..000000000
--- a/packages/server/src/apis/legacyCapabilities.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { OpenAPIHono } from '@hono/zod-openapi';
-import { getLegacyCapabilitiesRoute } from '../routes/legacyCapabilityRoutes';
-
-/** Legacy capabilities (mounted at /api/v1/legacy/capabilities). */
-export function createLegacyCapabilitiesRouter(deps: { sandboxEnabled: boolean }) {
- const router = new OpenAPIHono();
- router.openapi(getLegacyCapabilitiesRoute, c =>
- c.json(
- {
- data: {
- sandbox: { enabled: deps.sandboxEnabled },
- },
- },
- 200,
- ),
- );
- return router;
-}
diff --git a/packages/server/src/apis/legacyMcp.ts b/packages/server/src/apis/legacyMcp.ts
deleted file mode 100644
index f770ba943..000000000
--- a/packages/server/src/apis/legacyMcp.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import { OpenAPIHono, type RouteHandler } from '@hono/zod-openapi';
-import { extractErrorLogFields, isAuthRequired, McpConnectionError, RemoteMCP } from '@truefoundry/utils-core/core';
-import type { Logger } from 'winston';
-import type { McpStore } from '../legacy-registry-store/McpStore';
-import { listMcpServersRoute, listMcpToolsRoute } from '../routes/legacyMcpRoutes';
-
-export interface LegacyMcpRouterDeps {
- mcpStore: McpStore;
- logger: Logger;
-}
-
-/** Omits keys whose value is `undefined` so wire objects satisfy JSONValue index signatures. */
-function omitUndefinedEntries(obj: Record<string, unknown>): Record<string, unknown> {
- const out: Record<string, unknown> = {};
- for (const [key, value] of Object.entries(obj)) {
- if (value !== undefined) {
- out[key] = value;
- }
- }
- return out;
-}
-
-export function createLegacyMcpRouter(deps: LegacyMcpRouterDeps) {
- // auth_status here is a passive check only (no live refresh attempt); `authentication_required`
- // vs `not_required` — see route description.
- // TODO(mcp-dcr): once IMcpTokenStore lands, batch-check stored tokens for all DCR-configured
- // servers in one query instead of this config-only stub (never per-row — see db/postgres/AGENTS.md).
- const listMcpServersHandler: RouteHandler<typeof listMcpServersRoute> = c => {
- const data = deps.mcpStore.list().map(entry => ({
- ...entry,
- auth_status: entry.auth ? ('authentication_required' as const) : ('not_required' as const),
- }));
- return c.json({ data }, 200);
- };
-
- // Live MCP `tools/list` call against the configured server, no selectors applied.
- const listMcpToolsHandler: RouteHandler<typeof listMcpToolsRoute> = async c => {
- const { name } = c.req.valid('param');
- const entry = deps.mcpStore.get(name);
- if (!entry) {
- return c.json({ error: { message: `MCP server not found: ${name}` } }, 404);
- }
- const remote = new RemoteMCP({
- id: name,
- name,
- url: entry.url,
- headers: deps.mcpStore.getHeaders(name),
- logger: deps.logger,
- signal: c.req.raw.signal,
- });
- try {
- const response = await remote.listTools();
- if (isAuthRequired(response)) {
- return c.json({ error: { message: `MCP server "${name}" requires authentication` } }, 401);
- }
- const data = response.result.tools.map(tool => omitUndefinedEntries({ ...tool }));
- return c.json({ data }, 200);
- } catch (error) {
- if (error instanceof McpConnectionError) {
- deps.logger.warn(`MCP tools/list failed for "${name}"`, extractErrorLogFields(error));
- if (error.statusCode === 401) {
- return c.json({ error: { message: error.message } }, 401);
- }
- return c.json({ error: { message: error.message } }, 502);
- }
- throw error;
- }
- };
-
- const router = new OpenAPIHono();
- router.openapi(listMcpServersRoute, listMcpServersHandler);
- router.openapi(listMcpToolsRoute, listMcpToolsHandler);
- return router;
-}
diff --git a/packages/server/src/apis/legacyModels.ts b/packages/server/src/apis/legacyModels.ts
deleted file mode 100644
index f25689d71..000000000
--- a/packages/server/src/apis/legacyModels.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { OpenAPIHono } from '@hono/zod-openapi';
-import type { ModelStore } from '../legacy-registry-store/ModelStore';
-import { listLegacyModelsRoute } from '../routes/legacyModelRoutes';
-
-/** YAML-backed registry list (mounted at /api/v1/legacy/models). */
-export function createLegacyModelsRouter(store: ModelStore) {
- const router = new OpenAPIHono();
- router.openapi(listLegacyModelsRoute, c => c.json({ data: store.list() }, 200));
- return router;
-}
diff --git a/packages/server/src/apis/legacySkills.ts b/packages/server/src/apis/legacySkills.ts
deleted file mode 100644
index 3c32ac586..000000000
--- a/packages/server/src/apis/legacySkills.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { OpenAPIHono } from '@hono/zod-openapi';
-import type { SkillStore } from '../legacy-registry-store/SkillStore';
-import { listSkillsRoute } from '../routes/legacySkillRoutes';
-
-export function createLegacySkillsRouter(store: SkillStore) {
- const router = new OpenAPIHono();
- router.openapi(listSkillsRoute, c => c.json({ data: store.list() }, 200));
- return router;
-}
diff --git a/packages/server/src/apis/sessions.ts b/packages/server/src/apis/sessions.ts
index c2ba406d1..ab2fd4f22 100644
--- a/packages/server/src/apis/sessions.ts
+++ b/packages/server/src/apis/sessions.ts
@@ -1,5 +1,8 @@
+/**
+ * DB-backed sessions API (mounted at /api/v1/sessions).
+ */
import { OpenAPIHono, type RouteHandler } from '@hono/zod-openapi';
-import type { AgentSpec, ISessionStore, SessionRecord, Sessions } from '@truefoundry/utils-core/agent-session';
+import type { ISessionStore, SessionRecord, Sessions } from '@truefoundry/utils-core/agent-session';
import {
CancellationReason,
SessionStoreConflictError,
@@ -15,8 +18,9 @@ import type { RedisClientType } from 'redis';
import { ulid } from 'ulid';
import { z } from 'zod';
import configuration from '../config';
-import type { McpStore } from '../legacy-registry-store/McpStore';
-import type { ModelStore } from '../legacy-registry-store/ModelStore';
+import type { IMcpServerStore } from '../db/mcpServerStore';
+import type { IModelProviderStore } from '../db/modelProviderStore';
+import type { ISkillStore } from '../db/skillStore';
import {
cancelSessionRoute,
createSessionRoute,
@@ -27,6 +31,7 @@ import {
updateSessionRoute,
} from '../routes/sessionRoutes';
import type { ActiveTurnRegistry } from '../runtime/activeTurns';
+import { validateAgentSpecDb } from '../runtime/dbSessionResources';
import { executorFromTurnId } from '../runtime/peeringIds';
import type { Session } from '../schemas/session';
@@ -54,61 +59,15 @@ export function toWireSession(record: SessionRecord): Session {
};
}
-/**
- * Cross-checks an AgentSpec against the YAML catalogs and the server's
- * capabilities before a session is created or updated, so misconfigured specs
- * fail at admission instead of at turn time. Returns undefined when the spec
- * is usable; otherwise an error with the status to respond with: 400 when the
- * spec references unknown catalog entries (a client-side spec problem), 422
- * when the spec is valid but this deployment cannot satisfy it (missing
- * sandbox provider).
- */
-function validateAgentSpec(
- spec: AgentSpec,
- deps: { modelStore: ModelStore; mcpStore: McpStore; sandboxSupported: boolean },
-): { status: 400 | 422; message: string } | undefined {
- const model = deps.modelStore.get(spec.model.name);
- if (!model) {
- return { status: 400, message: `Unknown model "${spec.model.name}" — not declared in models.yaml` };
- }
- const reasoningEffort = spec.model.params?.reasoning_effort;
- if (reasoningEffort !== undefined && !model.reasoning_efforts?.includes(reasoningEffort)) {
- return {
- status: 400,
- message: model.reasoning_efforts
- ? `Reasoning effort "${reasoningEffort}" is not supported by model "${model.name}"`
- : `Model "${model.name}" does not support configurable reasoning effort`,
- };
- }
- for (const server of spec.mcp_servers ?? []) {
- if (!deps.mcpStore.get(server.name)) {
- return { status: 400, message: `Unknown MCP server "${server.name}" — not declared in mcp.yaml` };
- }
- }
- const wantsSandbox = spec.config?.sandbox?.enabled === true;
- const hasSkills = (spec.skills?.length ?? 0) > 0;
- if ((wantsSandbox || hasSkills) && !deps.sandboxSupported) {
- return {
- status: 422,
- message: hasSkills
- ? 'skills require a sandbox provider — set SANDBOX_SETTINGS (and SANDBOX_API_KEY)'
- : 'sandbox is enabled in the agent spec but this server has no sandbox provider configured — set SANDBOX_SETTINGS (and SANDBOX_API_KEY)',
- };
- }
- return undefined;
-}
-
export interface SessionsRouterDeps {
sessions: Sessions;
sessionStore: ISessionStore;
activeTurns: ActiveTurnRegistry;
- modelStore: ModelStore;
- mcpStore: McpStore;
- /** Whether a sandbox provider is configured (SANDBOX_SETTINGS); gates spec admission. */
+ modelProviderStore: IModelProviderStore;
+ mcpServerStore: IMcpServerStore;
+ skillStore: ISkillStore;
sandboxSupported: boolean;
- /** Reaches peer executors; undefined in single-binary mode. */
redis?: RedisClientType | undefined;
- /** Request-reply dispatch table this replica serves; cancel registers here. */
requestReplyRouter: RequestReplyRouter;
}
@@ -124,9 +83,8 @@ function cancelTurnOnThisExecutor(
}
/**
- * Peer-facing cancel handler (registered in createSessionsRouter): aborts the
- * turn if it runs in this process. 200 = abort fired, 412 = not running here
- * (treated by callers as a no-op).
+ * Peer-facing cancel handler: aborts the turn if it runs in this process.
+ * 200 = abort fired, 412 = not running here (treated by callers as a no-op).
*/
export function cancelSessionTurnPeerHandler(activeTurns: ActiveTurnRegistry): RequestReplyRouteHandler {
// Synchronous by nature; the transport expects a Promise and require-await
@@ -221,16 +179,18 @@ export async function cancelSessionTurn(
cancelTurnOnThisExecutor(deps.activeTurns, { sessionId, turnId, reason });
}
+/** DB-backed sessions (mounted at /api/v1/sessions). */
export function createSessionsRouter(deps: SessionsRouterDeps) {
const createSessionHandler: RouteHandler<typeof createSessionRoute> = async c => {
const body = c.req.valid('json');
- const specError = validateAgentSpec(body.agent_spec, deps);
- if (specError) {
- // Hono's typed responses require a literal status per call site.
- return specError.status === 422
- ? c.json({ error: { message: specError.message } }, 422)
- : c.json({ error: { message: specError.message } }, 400);
- }
+ await validateAgentSpecDb({
+ spec: body.agent_spec,
+ tenant_id: TENANT_ID,
+ modelProviderStore: deps.modelProviderStore,
+ mcpServerStore: deps.mcpServerStore,
+ skillStore: deps.skillStore,
+ sandboxSupported: deps.sandboxSupported,
+ });
const session = await deps.sessions.create({
tenant_id: TENANT_ID,
session_id: ulid().toLowerCase(),
@@ -258,12 +218,14 @@ export function createSessionsRouter(deps: SessionsRouterDeps) {
const { sessionId } = c.req.valid('param');
const body = c.req.valid('json');
if (body.agent_spec) {
- const specError = validateAgentSpec(body.agent_spec, deps);
- if (specError) {
- return specError.status === 422
- ? c.json({ error: { message: specError.message } }, 422)
- : c.json({ error: { message: specError.message } }, 400);
- }
+ await validateAgentSpecDb({
+ spec: body.agent_spec,
+ tenant_id: TENANT_ID,
+ modelProviderStore: deps.modelProviderStore,
+ mcpServerStore: deps.mcpServerStore,
+ skillStore: deps.skillStore,
+ sandboxSupported: deps.sandboxSupported,
+ });
}
try {
await deps.sessionStore.updateSession({
@@ -305,9 +267,6 @@ export function createSessionsRouter(deps: SessionsRouterDeps) {
}
};
- // Cancels only the session's tail (last_turn_id). Cancelling with no
- // running turn is a 200 no-op, matching the turn state machine (first
- // terminal write wins).
const cancelSessionHandler: RouteHandler<typeof cancelSessionRoute> = async c => {
const { sessionId } = c.req.valid('param');
const record = await deps.sessionStore.getSession({ tenant_id: TENANT_ID, session_id: sessionId });
@@ -355,7 +314,7 @@ export function createSessionsRouter(deps: SessionsRouterDeps) {
router.openapi(updateSessionRoute, updateSessionHandler);
router.openapi(listSessionsRoute, listSessionsHandler);
router.openapi(cancelSessionRoute, cancelSessionHandler);
- deps.requestReplyRouter.registerRoute(SESSIONS_CANCEL_PATH, cancelSessionTurnPeerHandler(deps.activeTurns));
router.openapi(listSessionEventsRoute, listSessionEventsHandler);
+ deps.requestReplyRouter.registerRoute(SESSIONS_CANCEL_PATH, cancelSessionTurnPeerHandler(deps.activeTurns));
return router;
}
diff --git a/packages/server/src/apis/turns.ts b/packages/server/src/apis/turns.ts
index c19576388..739a100a1 100644
--- a/packages/server/src/apis/turns.ts
+++ b/packages/server/src/apis/turns.ts
@@ -1,3 +1,6 @@
+/**
+ * DB-backed turns API (mounted at /api/v1/sessions).
+ */
import { OpenAPIHono, type RouteHandler } from '@hono/zod-openapi';
import type { ISessionStore, Sessions, Turn, TurnStreamingEvent } from '@truefoundry/utils-core/agent-session';
import {
@@ -9,7 +12,6 @@ import {
TurnResourceResolver,
type TurnInputItem,
type TurnRecordWithoutSnapshot,
- type TurnSandboxFactory,
} from '@truefoundry/utils-core/agent-session';
import {
AgentHarnessError,
@@ -18,14 +20,17 @@ import {
isFileContentPart,
McpConnectionError,
VercelAILLM,
+ type SandboxProvider,
+ type VercelAIProviderConfig,
} from '@truefoundry/utils-core/core';
import type { Context } from 'hono';
import { HTTPException } from 'hono/http-exception';
import { streamSSE } from 'hono/streaming';
import type { Logger } from 'winston';
import configuration from '../config';
-import type { McpStore } from '../legacy-registry-store/McpStore';
-import type { ModelStore } from '../legacy-registry-store/ModelStore';
+import type { IMcpServerStore } from '../db/mcpServerStore';
+import type { IModelProviderStore } from '../db/modelProviderStore';
+import type { ISkillStore } from '../db/skillStore';
import {
createAndExecuteTurnRoute,
getTurnRoute,
@@ -34,11 +39,13 @@ import {
subscribeTurnRoute,
} from '../routes/turnRoutes';
import type { ActiveTurnRegistry } from '../runtime/activeTurns';
+import { getDbMcpConnection, getDbProviderConfig, resolveDbGitSkills } from '../runtime/dbSessionResources';
import { StreamGoneError, type EventSubscriptionRegistry } from '../runtime/event-subscription';
import { mintPeeredTurnId } from '../runtime/peeringIds';
+import { buildTurnSandbox } from '../runtime/sandboxFactory';
import { TENANT_ID } from './sessions';
-function toWireTurn(record: TurnRecordWithoutSnapshot): Turn {
+export function toWireTurn(record: TurnRecordWithoutSnapshot): Turn {
return {
id: record.turn_id,
session_id: record.session_id,
@@ -53,44 +60,67 @@ export interface TurnsRouterDeps {
sessions: Sessions;
sessionStore: ISessionStore;
activeTurns: ActiveTurnRegistry;
- modelStore: ModelStore;
- mcpStore: McpStore;
+ modelProviderStore: IModelProviderStore;
+ mcpServerStore: IMcpServerStore;
+ skillStore: ISkillStore;
/** Resumable live turn-event transport: create-turn writes, subscribe polls. */
eventSubscriptions: EventSubscriptionRegistry<TurnStreamingEvent>;
- /** Built at boot from SANDBOX_SETTINGS; undefined = sandbox unsupported. */
- sandboxFactory?: TurnSandboxFactory;
+ /** Shared provider from SANDBOX_SETTINGS; undefined = sandbox unsupported. */
+ sandboxProvider?: SandboxProvider;
logger: Logger;
}
/**
- * Per-run resource wiring: maps the YAML catalogs onto the agentSession
- * TurnResourceResolver. Each model carries its own provider config from
- * models.yaml; MCP servers resolve to url + env-configured headers;
- * the sandbox factory (when configured) creates/reattaches the run's Sandbox.
+ * TurnResourceResolver requires a sync llm factory; preload the session model
+ * config so the factory stays sync while the store read stays async.
*/
function createTurnResolver(deps: {
- modelStore: ModelStore;
- mcpStore: McpStore;
- sandboxFactory?: TurnSandboxFactory | undefined;
+ mcpServerStore: IMcpServerStore;
+ skillStore: ISkillStore;
+ sandboxProvider?: SandboxProvider | undefined;
logger: Logger;
signal: AbortSignal;
+ modelName: string;
+ providerConfig: VercelAIProviderConfig;
}): TurnResourceResolver {
- const { modelStore, mcpStore, logger, signal } = deps;
+ const { mcpServerStore, skillStore, logger, signal, modelName, providerConfig } = deps;
+ const sandboxProvider = deps.sandboxProvider;
return new TurnResourceResolver({
- llm: name =>
- new VercelAILLM({
- providerConfig: modelStore.getProviderConfig(name),
+ llm: name => {
+ if (name !== modelName) {
+ throw new Error(`Model not registered: ${name}`);
+ }
+ return new VercelAILLM({
+ providerConfig,
logger,
signal,
- }),
- mcp: name => {
- const entry = mcpStore.get(name);
- if (!entry) {
- throw new Error(`MCP server not declared in mcp.yaml: ${name}`);
- }
- return Promise.resolve({ url: entry.url, headers: mcpStore.getHeaders(name) });
+ });
},
- ...(deps.sandboxFactory ? { sandboxProvider: deps.sandboxFactory } : {}),
+ mcp: async name =>
+ getDbMcpConnection({
+ tenant_id: TENANT_ID,
+ name,
+ store: mcpServerStore,
+ }),
+ ...(sandboxProvider
+ ? {
+ sandboxProvider: async ({ spec, existingSandboxId, tracing }) => {
+ const gitSkills = await resolveDbGitSkills({
+ tenant_id: TENANT_ID,
+ skills: spec.skills ?? [],
+ store: skillStore,
+ });
+ return buildTurnSandbox({
+ provider: sandboxProvider,
+ logger,
+ gitSkills,
+ fileDownloadEnabled: spec.config?.sandbox?.file_downloads ?? false,
+ existingSandboxId,
+ tracing,
+ });
+ },
+ }
+ : {}),
logger,
});
}
@@ -102,7 +132,7 @@ const MAX_SESSION_TITLE_LENGTH = 50;
* trimmed text (capped at {@link MAX_SESSION_TITLE_LENGTH}) or `undefined` when no usable
* text is present (e.g. file-only or tool-approval input).
*/
-function deriveSessionTitle(input: TurnInputItem[] | undefined): string | undefined {
+export function deriveSessionTitle(input: TurnInputItem[] | undefined): string | undefined {
const firstUserMessage = input?.find(isAgentInputUserMessage);
if (!firstUserMessage) {
return undefined;
@@ -123,8 +153,12 @@ function deriveSessionTitle(input: TurnInputItem[] | undefined): string | undefi
return trimmed.slice(0, MAX_SESSION_TITLE_LENGTH);
}
-/** SSE payload: `id` carries the per-stream sequence number; the body is not numbered. */
-function turnEventSsePayload(event: TurnStreamingEvent, sequenceNumber: number): { id: string; data: string } {
+/**
+ * SSE payload for one turn event. The `id` field carries the per-stream
+ * sequence number; the event body itself is not numbered (yield order is
+ * persist order, so the transport boundary stamps).
+ */
+export function turnEventSsePayload(event: TurnStreamingEvent, sequenceNumber: number): { id: string; data: string } {
return {
id: String(sequenceNumber),
data: JSON.stringify(event),
@@ -135,7 +169,7 @@ function turnEventSsePayload(event: TurnStreamingEvent, sequenceNumber: number):
* turn.created arms the active-run TTL, turn.done shortens it to the
* post-completion drain window; mid-run events leave the TTL untouched.
*/
-function streamTTLSecondsFor(event: TurnStreamingEvent): number | undefined {
+export function streamTTLSecondsFor(event: TurnStreamingEvent): number | undefined {
if (event.type === EventType.TURN_CREATED) {
return configuration.TURN_STREAM_TTL_SECONDS;
}
@@ -146,7 +180,7 @@ function streamTTLSecondsFor(event: TurnStreamingEvent): number | undefined {
}
/** Redis/in-memory key for one turn's resumable event stream. */
-function turnStreamId(tenantId: string, sessionId: string, turnId: string): string {
+export function turnStreamId(tenantId: string, sessionId: string, turnId: string): string {
return `agent:turn:${tenantId}:${sessionId}:${turnId}:stream`;
}
@@ -156,7 +190,7 @@ function turnStreamId(tenantId: string, sessionId: string, turnId: string): stri
* event, whereas the body is the original caller-supplied cursor and never
* changes between reconnect attempts.
*/
-function resolveAfterSequenceNumber(c: Context, bodyAfterSequenceNumber?: number): number | undefined {
+export function resolveAfterSequenceNumber(c: Context, bodyAfterSequenceNumber?: number): number | undefined {
const lastEventId = c.req.header('last-event-id');
if (lastEventId) {
const sequenceNumber = Number(lastEventId);
@@ -168,6 +202,7 @@ function resolveAfterSequenceNumber(c: Context, bodyAfterSequenceNumber?: number
return bodyAfterSequenceNumber;
}
+/** DB-backed turns (mounted at /api/v1/sessions). */
export function createTurnsRouter(deps: TurnsRouterDeps) {
const listTurnsHandler: RouteHandler<typeof listTurnsRoute> = async c => {
const { sessionId } = c.req.valid('param');
@@ -239,12 +274,20 @@ export function createTurnsRouter(deps: TurnsRouterDeps) {
}
const abortController = new AbortController();
+ const modelName = session.agent_spec.model.name;
+ const providerConfig = await getDbProviderConfig({
+ tenant_id: TENANT_ID,
+ name: modelName,
+ store: deps.modelProviderStore,
+ });
const resolver = createTurnResolver({
- modelStore: deps.modelStore,
- mcpStore: deps.mcpStore,
- sandboxFactory: deps.sandboxFactory,
+ mcpServerStore: deps.mcpServerStore,
+ skillStore: deps.skillStore,
+ sandboxProvider: deps.sandboxProvider,
logger: deps.logger,
signal: abortController.signal,
+ modelName,
+ providerConfig,
});
// First turn only: derive the title from the first user message. The store
@@ -262,20 +305,15 @@ export function createTurnsRouter(deps: TurnsRouterDeps) {
update_session_title_if_not_exist: title,
});
} catch (error) {
- // Unknown previous_turn_id (nothing was persisted).
if (error instanceof SessionStoreNotFoundError) {
return c.json({ error: { message: error.message } }, 404);
}
- // Input/spec validation failures from the harness. MCP failures carry
- // their own status but the wire contract only declares 400 here.
if (error instanceof AgentHarnessError && !(error instanceof McpConnectionError)) {
return c.json({ error: { message: error.message } }, 400);
}
throw error;
}
- // Long timer not tied to any await; without unref() it would keep the process alive.
- // Armed only after createTurn succeeds so a 4xx path never leaks a pending timer.
const maxExecutionTimer = setTimeout(() => {
if (!abortController.signal.aborted) {
abortController.abort(CancellationReason.ServerExecutionTimeout);
@@ -294,15 +332,10 @@ export function createTurnsRouter(deps: TurnsRouterDeps) {
// Held for the whole turn; the stream's sequence counter dies with it.
const turnEventStream = deps.eventSubscriptions.get(turnStreamId(TENANT_ID, sessionId, turn.id));
return streamSSE(c, async stream => {
- // On client disconnect stop writing but keep draining, so the turn
- // completes and its events persist.
stream.onAbort(() => {
shouldWriteToSSEStream = false;
});
try {
- // Slow SSE writes backpressure turn.stream() (and thus agent execution /
- // persistence). Acceptable for now; reintroduce an eager buffer if clients
- // stall turns in practice.
for await (const event of trackedStream) {
// Dual-write before SSE so subscribers can resume even after the
// creating client disconnects; the returned sequence is the SSE id.
@@ -319,7 +352,6 @@ export function createTurnsRouter(deps: TurnsRouterDeps) {
}
}
} catch (error) {
- // Session delete can cascade mid-stream; store misses leave the DB clean but end SSE here.
if (error instanceof SessionStoreNotFoundError) {
deps.logger.warn('Turn stream ended after session/turn was removed', {
sessionId,
diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts
index d71134539..32c3e375e 100644
--- a/packages/server/src/app.ts
+++ b/packages/server/src/app.ts
@@ -1,23 +1,14 @@
/** The API: resource routers, the OpenAPI document and Swagger UI, all under /api/v1. */
import { swaggerUI } from '@hono/swagger-ui';
import { OpenAPIHono } from '@hono/zod-openapi';
-import type {
- ISessionStore,
- Sessions,
- TurnSandboxFactory,
- TurnStreamingEvent,
-} from '@truefoundry/utils-core/agent-session';
-import type { IOAuthTokenStore } from '@truefoundry/utils-core/core';
+import type { ISessionStore, Sessions, TurnStreamingEvent } from '@truefoundry/utils-core/agent-session';
+import type { IOAuthTokenStore, SandboxProvider } from '@truefoundry/utils-core/core';
import type { RequestReplyRouter } from '@truefoundry/utils-core/request-reply';
import type { Context } from 'hono';
import { HTTPException } from 'hono/http-exception';
import type { RedisClientType } from 'redis';
import type { Logger } from 'winston';
import { createCapabilitiesRouter } from './apis/capabilities';
-import { createLegacyCapabilitiesRouter } from './apis/legacyCapabilities';
-import { createLegacyMcpRouter } from './apis/legacyMcp';
-import { createLegacyModelsRouter } from './apis/legacyModels';
-import { createLegacySkillsRouter } from './apis/legacySkills';
import { createMcpOAuthRouter } from './apis/mcpOAuth';
import { createAvailableMcpServersRouter } from './apis/mcpServers';
import { createModelsRouter } from './apis/models';
@@ -33,9 +24,6 @@ import type { IMcpServerStore } from './db/mcpServerStore';
import type { IModelProviderStore } from './db/modelProviderStore';
import type { ISandboxProviderStore } from './db/sandboxProviderStore';
import type { ISkillStore } from './db/skillStore';
-import type { McpStore } from './legacy-registry-store/McpStore';
-import type { ModelStore } from './legacy-registry-store/ModelStore';
-import type { SkillStore } from './legacy-registry-store/SkillStore';
import type { ActiveTurnRegistry } from './runtime/activeTurns';
import type { EventSubscriptionRegistry } from './runtime/event-subscription';
@@ -43,7 +31,7 @@ const openApiDocConfig = {
openapi: '3.1.0',
info: {
title: 'Agent Server',
- description: 'Agent server exposing models, MCP servers and skills from local YAML config.',
+ description: 'Agent server with DB-backed sessions, settings catalogs, and model/MCP/skill providers.',
version: '0.1.0',
},
};
@@ -58,23 +46,20 @@ function routeNotFound(c: Context) {
}
export interface ServerDeps {
- modelStore: ModelStore;
modelCatalog: ModelCatalog;
modelProviderStore: IModelProviderStore;
mcpCatalog: McpCatalog;
mcpServerStore: IMcpServerStore;
tokenStore: IOAuthTokenStore;
- mcpStore: McpStore;
skillCatalog: SkillCatalog;
skillStore: ISkillStore;
sandboxCatalog: SandboxCatalog;
sandboxProviderStore: ISandboxProviderStore;
- legacySkillStore: SkillStore;
sessionStore: ISessionStore;
sessions: Sessions;
activeTurns: ActiveTurnRegistry;
- /** Built at boot from SANDBOX_SETTINGS; undefined = sandbox unsupported. */
- sandboxFactory?: TurnSandboxFactory;
+ /** Shared SandboxProvider from SANDBOX_SETTINGS; undefined = sandbox unsupported. */
+ sandboxProvider?: SandboxProvider;
/** Primary Redis client (server-owned); undefined in single-binary mode. */
redis?: RedisClientType | undefined;
/** Request-reply dispatch table served by this replica's executor. */
@@ -117,23 +102,16 @@ export function createServerApp(deps: ServerDeps) {
logger: deps.logger,
}),
);
- // YAML registry surfaces — still used by sessions/turns and the legacy UI paths.
- app.route('/api/v1/legacy/models', createLegacyModelsRouter(deps.modelStore));
- app.route('/api/v1/legacy/mcp-servers', createLegacyMcpRouter({ mcpStore: deps.mcpStore, logger: deps.logger }));
- app.route('/api/v1/legacy/skills', createLegacySkillsRouter(deps.legacySkillStore));
- app.route(
- '/api/v1/legacy/capabilities',
- createLegacyCapabilitiesRouter({ sandboxEnabled: deps.sandboxFactory !== undefined }),
- );
app.route(
'/api/v1/sessions',
createSessionsRouter({
sessions: deps.sessions,
sessionStore: deps.sessionStore,
activeTurns: deps.activeTurns,
- modelStore: deps.modelStore,
- mcpStore: deps.mcpStore,
- sandboxSupported: deps.sandboxFactory !== undefined,
+ modelProviderStore: deps.modelProviderStore,
+ mcpServerStore: deps.mcpServerStore,
+ skillStore: deps.skillStore,
+ sandboxSupported: deps.sandboxProvider !== undefined,
redis: deps.redis,
requestReplyRouter: deps.requestReplyRouter,
}),
@@ -144,10 +122,11 @@ export function createServerApp(deps: ServerDeps) {
sessions: deps.sessions,
sessionStore: deps.sessionStore,
activeTurns: deps.activeTurns,
- modelStore: deps.modelStore,
- mcpStore: deps.mcpStore,
+ modelProviderStore: deps.modelProviderStore,
+ mcpServerStore: deps.mcpServerStore,
+ skillStore: deps.skillStore,
eventSubscriptions: deps.eventSubscriptions,
- ...(deps.sandboxFactory ? { sandboxFactory: deps.sandboxFactory } : {}),
+ ...(deps.sandboxProvider ? { sandboxProvider: deps.sandboxProvider } : {}),
logger: deps.logger,
}),
);
diff --git a/packages/server/src/catalog/loadYaml.ts b/packages/server/src/catalog/loadYaml.ts
index 6dc8695ae..25c8f930e 100644
--- a/packages/server/src/catalog/loadYaml.ts
+++ b/packages/server/src/catalog/loadYaml.ts
@@ -4,10 +4,8 @@
* pointing at the offending file.
*/
import fs from 'node:fs';
-import path from 'node:path';
import { parse } from 'yaml';
import type { z } from 'zod';
-import configuration from '../config';
/** Parses and validates YAML text. `label` is used in error messages. */
export function parseYamlString<T>(raw: string, schema: z.ZodType<T>, label: string): T {
@@ -43,8 +41,3 @@ export function loadYamlAtPath<T>(filePath: string, schema: z.ZodType<T>): T {
return parseYamlString(raw, schema, filePath);
}
-
-/** Loads a YAML file from `REGISTRY_DIR` (legacy registry stores). */
-export function loadYamlFile<T>(fileName: string, schema: z.ZodType<T>): T {
- return loadYamlAtPath(path.join(configuration.REGISTRY_DIR, fileName), schema);
-}
diff --git a/packages/server/src/config.ts b/packages/server/src/config.ts
index 2e66b0a5b..7754bbeff 100644
--- a/packages/server/src/config.ts
+++ b/packages/server/src/config.ts
@@ -8,17 +8,6 @@
*/
import path from 'node:path';
-// ============================================================================
-// CONFIG FILES
-// ============================================================================
-
-/** YAML files the stores load from `REGISTRY_DIR` at startup. */
-export const CONFIG_FILES = {
- models: 'models.yaml',
- mcpServers: 'mcp.yaml',
- skills: 'skills.yaml',
-} as const;
-
// ============================================================================
// HELPER FUNCTIONS
// ============================================================================
@@ -46,84 +35,6 @@ export const getEnv = (key: string, options?: GetEnvOptions): string | undefined
return undefined;
};
-/**
- * Normalizes a model/MCP name to the `{NAME}` segment of its env var:
- * uppercase, with every run of non-alphanumeric characters collapsed to `_`.
- * Example: model `gpt-5` -> `GPT_5` -> env var `MODEL_GPT_5_HEADERS`.
- */
-export function normalizeEnvName(name: string): string {
- return name.replace(/[^a-zA-Z0-9]+/g, '_').toUpperCase();
-}
-
-/**
- * Parses a headers env var: must be a JSON object with string values.
- * Malformed values throw so a typo'd credential block fails at startup
- * instead of surfacing as auth errors mid-run. Unset values yield an empty
- * record.
- */
-export const parseHeaders = (envKey: string, raw: string | undefined): Record<string, string> => {
- if (raw === undefined) {
- return {};
- }
- let parsed: unknown;
- try {
- parsed = JSON.parse(raw);
- } catch (error) {
- throw new Error(
- `Environment variable ${envKey} must be valid JSON: ${error instanceof Error ? error.message : String(error)}`,
- { cause: error },
- );
- }
- if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
- throw new Error(`Environment variable ${envKey} must be a JSON object of string values`);
- }
- const headers: Record<string, string> = {};
- for (const [key, value] of Object.entries(parsed)) {
- if (typeof value !== 'string') {
- throw new Error(`Environment variable ${envKey} must only contain string values (key "${key}" is not a string)`);
- }
- headers[key] = value;
- }
- return headers;
-};
-
-/**
- * Collects `{PREFIX}_{NAME}_HEADERS` env vars into a map keyed by the
- * normalized `{NAME}` — the same normalization lookups use, so any casing of
- * the env var name works. The default `{PREFIX}_HEADERS` var never matches
- * (the regex requires a non-empty `{NAME}` segment).
- */
-export const parseHeadersByName = (prefix: 'MODEL' | 'MCP'): Record<string, Record<string, string>> => {
- const pattern = new RegExp(`^${prefix}_(.+)_HEADERS$`);
- const byName: Record<string, Record<string, string>> = {};
- for (const [envKey, raw] of Object.entries(process.env)) {
- const match = envKey.match(pattern);
- if (!match || raw === undefined) continue;
- const name = match[1];
- if (name === undefined) continue;
- byName[normalizeEnvName(name)] = parseHeaders(envKey, raw);
- }
- return byName;
-};
-
-/**
- * Collects `MODEL_{NAME}_API_KEY` env vars into a map keyed by the normalized
- * `{NAME}`. The default `MODEL_API_KEY` var never matches (the regex requires
- * a non-empty `{NAME}` segment).
- */
-export const parseApiKeysByName = (): Record<string, string> => {
- const pattern = /^MODEL_(.+)_API_KEY$/;
- const byName: Record<string, string> = {};
- for (const [envKey, raw] of Object.entries(process.env)) {
- const match = pattern.exec(envKey);
- if (!match || raw === undefined) continue;
- const name = match[1];
- if (name === undefined) continue;
- byName[normalizeEnvName(name)] = raw;
- }
- return byName;
-};
-
function randomAlphanumeric(length: number): string {
return Array.from({ length }, () => Math.floor(Math.random() * 36).toString(36)).join('');
}
@@ -194,7 +105,7 @@ export const buildPostgresConnectionString = (parts: {
export const DEFAULT_PORT = 8790;
-/** Relative to the working directory, like REGISTRY_DIR; the image sets an absolute FRONTEND_DIR. */
+/** Relative to the working directory; the image sets an absolute FRONTEND_DIR. */
const DEFAULT_FRONTEND_DIR = '../frontend/dist';
/** Turn ids minted by a single-binary process; no peer can ever own them. */
@@ -221,35 +132,28 @@ export interface ServerConfiguration {
PORT: number;
/** Peering identity embedded in the turn ids this process mints; `local` in single-binary mode. */
EXECUTOR_ID: string;
- /**
- * Absolute path to the directory containing the YAML config files
- * (models.yaml, mcp.yaml, skills.yaml). Relative values are resolved
- * against the working directory. Env: `REGISTRY_DIR`, defaults to
- * `./registry`.
- */
- REGISTRY_DIR: string;
/**
* Optional override for the model catalog YAML (discovery presets for
* GET /settings/model-providers/catalog). When unset, the catalog inlined at build
- * time is used. Separate from `REGISTRY_DIR`. Env: `MODEL_CATALOG_PATH`.
+ * time is used. Env: `MODEL_CATALOG_PATH`.
*/
MODEL_CATALOG_PATH: string | undefined;
/**
* Optional override for the MCP catalog YAML (discovery presets for
* GET /settings/mcp-servers/catalog). When unset, the catalog inlined at build
- * time is used. Separate from `REGISTRY_DIR`. Env: `MCP_CATALOG_PATH`.
+ * time is used. Env: `MCP_CATALOG_PATH`.
*/
MCP_CATALOG_PATH: string | undefined;
/**
* Optional override for the skill catalog YAML (discovery presets for
* GET /settings/skills/catalog). When unset, the catalog inlined at build
- * time is used. Separate from `REGISTRY_DIR`. Env: `SKILL_CATALOG_PATH`.
+ * time is used. Env: `SKILL_CATALOG_PATH`.
*/
SKILL_CATALOG_PATH: string | undefined;
/**
* Optional override for the sandbox catalog YAML (discovery presets for
* GET /settings/sandbox-providers/catalog). When unset, the catalog inlined at build
- * time is used. Separate from `REGISTRY_DIR`. Env: `SANDBOX_CATALOG_PATH`.
+ * time is used. Env: `SANDBOX_CATALOG_PATH`.
*/
SANDBOX_CATALOG_PATH: string | undefined;
/**
@@ -257,31 +161,6 @@ export interface ServerConfiguration {
* Env: `FRONTEND_DIR`, defaults to `../frontend/dist` relative to the working directory.
*/
FRONTEND_DIR: string;
- /**
- * Default API key for the OpenAI-compatible API at models.yaml's base_url,
- * sent as `Authorization: Bearer <key>` on every model request.
- * Env: `MODEL_API_KEY` (required).
- */
- MODEL_API_KEY: string;
- /**
- * Per-model API key overrides keyed by normalized model name.
- * Env: `MODEL_{NAME}_API_KEY` (see `normalizeEnvName`).
- */
- MODEL_API_KEY_BY_NAME: Record<string, string>;
- /** Extra headers applied to every model request. Env: `MODEL_HEADERS`. */
- MODEL_HEADERS: Record<string, string>;
- /**
- * Per-model header overrides keyed by normalized model name.
- * Env: `MODEL_{NAME}_HEADERS` (see `normalizeEnvName`).
- */
- MODEL_HEADERS_BY_NAME: Record<string, Record<string, string>>;
- /** Default headers applied to every MCP server request. Env: `MCP_HEADERS`. */
- MCP_HEADERS: Record<string, string>;
- /**
- * Per-MCP-server header overrides keyed by normalized server name.
- * Env: `MCP_{NAME}_HEADERS` (see `normalizeEnvName`).
- */
- MCP_HEADERS_BY_NAME: Record<string, Record<string, string>>;
/**
* Public base URL of this server used as the origin of the MCP OAuth callback
* (`{PUBLIC_BASE_URL}/api/v1/mcp-servers/oauth/callback`). Not trimmed.
@@ -408,7 +287,6 @@ const singleBinary = parseBoolean({
const configuration: ServerConfiguration = {
PORT: parsePort(getEnv('PORT')),
EXECUTOR_ID: resolveExecutorId(singleBinary),
- REGISTRY_DIR: path.resolve(getEnv('REGISTRY_DIR', { defaultValue: 'registry' }) ?? 'registry'),
MODEL_CATALOG_PATH: (() => {
const override = getEnv('MODEL_CATALOG_PATH');
return override === undefined || override === '' ? undefined : path.resolve(override);
@@ -426,12 +304,6 @@ const configuration: ServerConfiguration = {
return override === undefined || override === '' ? undefined : path.resolve(override);
})(),
FRONTEND_DIR: path.resolve(getEnv('FRONTEND_DIR', { defaultValue: DEFAULT_FRONTEND_DIR }) ?? DEFAULT_FRONTEND_DIR),
- MODEL_API_KEY: getEnv('MODEL_API_KEY', { required: true }) ?? '',
- MODEL_API_KEY_BY_NAME: parseApiKeysByName(),
- MODEL_HEADERS: parseHeaders('MODEL_HEADERS', getEnv('MODEL_HEADERS')),
- MODEL_HEADERS_BY_NAME: parseHeadersByName('MODEL'),
- MCP_HEADERS: parseHeaders('MCP_HEADERS', getEnv('MCP_HEADERS')),
- MCP_HEADERS_BY_NAME: parseHeadersByName('MCP'),
PUBLIC_BASE_URL: getEnv('PUBLIC_BASE_URL', { required: true }) ?? '',
OAUTH_CLIENT_NAME: getEnv('OAUTH_CLIENT_NAME', { defaultValue: 'truefoundry-harness' }) ?? 'truefoundry-harness',
SANDBOX_SETTINGS: getEnv('SANDBOX_SETTINGS'),
diff --git a/packages/server/src/legacy-registry-store/McpStore.ts b/packages/server/src/legacy-registry-store/McpStore.ts
deleted file mode 100644
index 1c11c92a0..000000000
--- a/packages/server/src/legacy-registry-store/McpStore.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Catalog of MCP servers from mcp.yaml. Auth headers come from the
- * MCP_HEADERS / MCP_{NAME}_HEADERS env vars and are never exposed in list
- * output.
- */
-import { loadYamlFile } from '../catalog/loadYaml';
-import configuration, { CONFIG_FILES, normalizeEnvName } from '../config';
-import { McpFileSchema, type McpServerEntry } from './schemas';
-
-export class McpStore {
- private readonly mcpServers: McpServerEntry[];
-
- constructor(mcpServers: McpServerEntry[]) {
- this.mcpServers = mcpServers;
- }
-
- /** Loads and validates mcp.yaml. Throws on any error. */
- static load(): McpStore {
- return new McpStore(loadYamlFile(CONFIG_FILES.mcpServers, McpFileSchema).mcp_servers);
- }
-
- list(): McpServerEntry[] {
- return this.mcpServers;
- }
-
- get(name: string): McpServerEntry | undefined {
- return this.mcpServers.find(server => server.name === name);
- }
-
- /** Headers for requests to the given MCP server: defaults overlaid with per-server overrides. */
- getHeaders(name: string): Record<string, string> {
- return {
- ...configuration.MCP_HEADERS,
- ...configuration.MCP_HEADERS_BY_NAME[normalizeEnvName(name)],
- };
- }
-}
diff --git a/packages/server/src/legacy-registry-store/ModelStore.ts b/packages/server/src/legacy-registry-store/ModelStore.ts
deleted file mode 100644
index eccb8a331..000000000
--- a/packages/server/src/legacy-registry-store/ModelStore.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Catalog of models from models.yaml. Each model declares its own provider so
- * direct vendors (openai, anthropic, google, mistral, …) and gateways
- * (truefoundry, litellm, openrouter, …) can be mixed freely.
- *
- * Credentials are injected at runtime from env vars and are never exposed in
- * list output.
- */
-import { loadYamlFile } from '../catalog/loadYaml';
-import configuration, { CONFIG_FILES, normalizeEnvName } from '../config';
-import { ModelsFileSchema, type ModelEntry } from './schemas';
-
-/**
- * Resolves `${VAR_NAME}` placeholders in a template string using `process.env`.
- * Throws clearly if a referenced variable is not set so misconfiguration is
- * caught at startup rather than silently producing empty credentials.
- */
-function substituteEnvVars(template: string): string {
- return template.replace(/\$\{([^}]+)\}/g, (_, varName: string) => {
- const value = process.env[varName];
- if (value === undefined) {
- throw new Error(`Environment variable "${varName}" is not set (referenced in models.yaml api_key or headers)`);
- }
- return value;
- });
-}
-
-/** ModelEntry merged with the runtime credentials for that model. */
-export type ProviderConfig = ModelEntry & {
- apiKey: string;
- headers: Record<string, string>;
-};
-
-export class ModelStore {
- private readonly models: ModelEntry[];
-
- constructor(models: ModelEntry[]) {
- this.models = models;
- }
-
- /** Loads and validates models.yaml. Throws on any error. */
- static load(): ModelStore {
- const file = loadYamlFile(CONFIG_FILES.models, ModelsFileSchema);
- return new ModelStore(file.models);
- }
-
- list(): ModelEntry[] {
- return this.models;
- }
-
- get(name: string): ModelEntry | undefined {
- return this.models.find(model => model.name === name);
- }
-
- /**
- * API key for the given model.
- *
- * Resolution order (first match wins):
- * 1. `api_key` field in models.yaml (supports `${VAR}` substitution)
- * 2. `MODEL_{NAME}_API_KEY` env var
- * 3. `MODEL_API_KEY` env var (global default)
- */
- getApiKey(name: string): string {
- const entry = this.get(name);
- if (entry?.api_key !== undefined) {
- return substituteEnvVars(entry.api_key);
- }
- return configuration.MODEL_API_KEY_BY_NAME[normalizeEnvName(name)] ?? configuration.MODEL_API_KEY;
- }
-
- /**
- * Extra headers for requests to the given model.
- *
- * Merged in ascending priority order:
- * 1. `MODEL_HEADERS` env var (global)
- * 2. `MODEL_{NAME}_HEADERS` env var (per-model)
- * 3. `headers` field in models.yaml (supports `${VAR}` substitution in values)
- */
- getHeaders(name: string): Record<string, string> {
- const entry = this.get(name);
- const inlineHeaders: Record<string, string> = {};
- if (entry?.headers !== undefined) {
- for (const [key, value] of Object.entries(entry.headers)) {
- inlineHeaders[key] = substituteEnvVars(value);
- }
- }
- return {
- ...configuration.MODEL_HEADERS,
- ...configuration.MODEL_HEADERS_BY_NAME[normalizeEnvName(name)],
- ...inlineHeaders,
- };
- }
-
- /**
- * Full provider config for a model: entry fields (provider, base_url, …)
- * merged with the resolved API key and headers for use by VercelAILLM.
- * Throws if the model is not registered.
- */
- getProviderConfig(name: string): ProviderConfig {
- const entry = this.get(name);
- if (!entry) {
- throw new Error(`Model not registered in models.yaml: ${name}`);
- }
- return {
- ...entry,
- apiKey: this.getApiKey(name),
- headers: this.getHeaders(name),
- };
- }
-}
diff --git a/packages/server/src/legacy-registry-store/SkillStore.ts b/packages/server/src/legacy-registry-store/SkillStore.ts
deleted file mode 100644
index 7462aafd0..000000000
--- a/packages/server/src/legacy-registry-store/SkillStore.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Catalog of agent skills from skills.yaml (git-based skills).
- */
-import { loadYamlFile } from '../catalog/loadYaml';
-import { CONFIG_FILES } from '../config';
-import { SkillsFileSchema, type SkillEntry } from './schemas';
-
-export class SkillStore {
- private readonly skills: SkillEntry[];
-
- constructor(skills: SkillEntry[]) {
- this.skills = skills;
- }
-
- /** Loads and validates skills.yaml. Throws on any error. */
- static load(): SkillStore {
- return new SkillStore(loadYamlFile(CONFIG_FILES.skills, SkillsFileSchema).skills);
- }
-
- list(): SkillEntry[] {
- return this.skills;
- }
-
- get(name: string): SkillEntry | undefined {
- return this.skills.find(skill => skill.name === name);
- }
-}
diff --git a/packages/server/src/legacy-registry-store/schemas.ts b/packages/server/src/legacy-registry-store/schemas.ts
deleted file mode 100644
index b6c897599..000000000
--- a/packages/server/src/legacy-registry-store/schemas.ts
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * Zod schemas for the legacy YAML registry files (models.yaml, mcp.yaml, skills.yaml).
- * Separate from DB-backed model-provider / catalog schemas under src/schemas/.
- * Validation is strict: unknown keys, duplicate names, or missing fields make
- * the server fail at startup.
- *
- * TODO: settle the `.openapi()` names below; they become the SDK's exported types.
- */
-import { z } from '@hono/zod-openapi';
-import { normalizeEnvName } from '../config';
-import { uniqueNames } from '../schemas/common';
-
-/**
- * Adds a validation issue if two names normalize to the same `{NAME}` env var
- * segment (e.g. "foo-bar" and "foo_bar"), since they couldn't get separate
- * per-name overrides.
- */
-function uniqueEnvNames(entries: { name: string }[], ctx: z.RefinementCtx): void {
- const seenByEnvName = new Map<string, string>();
- for (const entry of entries) {
- const envName = normalizeEnvName(entry.name);
- const existing = seenByEnvName.get(envName);
- if (existing && existing !== entry.name) {
- ctx.addIssue({
- code: z.ZodIssueCode.custom,
- message: `Names "${existing}" and "${entry.name}" both map to the "${envName}" env var segment — rename one so they can be configured separately`,
- });
- } else {
- seenByEnvName.set(envName, entry.name);
- }
- }
-}
-
-const ModelEntryBaseSchema = z.object({
- /**
- * Display name / alias used in the API, env vars, and the registry.
- * Also sent to the provider as the model identifier when `model_id` is absent.
- */
- name: z
- .string()
- .min(1)
- .regex(
- /^[a-z0-9][a-z0-9.-]*$/,
- 'name must start with a letter or digit and contain only lowercase a-z, 0-9, hyphens, and dots',
- ),
- /**
- * The model identifier sent to the provider (e.g. `anthropic/claude-sonnet-4-6`
- * for a gateway). Use when the provider-facing ID isn't a valid `name`.
- */
- model_id: z.string().min(1).optional(),
- max_output_tokens: z.number().int().positive(),
- reasoning_efforts: z.array(z.string().min(1)).min(1).optional(),
- /**
- * API key for this model, supports `${ENV_VAR}` substitution.
- * Falls back to MODEL_{NAME}_API_KEY, then MODEL_API_KEY when absent.
- */
- api_key: z.string().min(1).optional(),
- /**
- * Extra HTTP headers for requests to this model, supports `${ENV_VAR}` substitution.
- * Merged on top of MODEL_HEADERS and MODEL_{NAME}_HEADERS env var headers.
- */
- headers: z.record(z.string()).optional(),
-});
-
-/** OpenAI provider entry — always uses the Responses API. */
-const OpenAIProviderEntrySchema = ModelEntryBaseSchema.extend({
- provider: z.literal('openai'),
- /** Override the default OpenAI base URL (e.g. Azure OpenAI endpoint). */
- base_url: z.string().url().optional(),
-})
- .strict()
- .openapi('OpenAIProviderModelEntry');
-
-/** Anthropic provider entry — backed by the dedicated Vercel AI SDK adapter. */
-const AnthropicProviderEntrySchema = ModelEntryBaseSchema.extend({
- provider: z.literal('anthropic'),
- /** Override the provider's default base URL (e.g. point at a local proxy). */
- base_url: z.string().url().optional(),
-})
- .strict()
- .openapi('AnthropicProviderModelEntry');
-
-/** Google Gemini provider entry — backed by the dedicated Vercel AI SDK adapter. */
-const GoogleGeminiProviderEntrySchema = ModelEntryBaseSchema.extend({
- provider: z.literal('google-gemini'),
- /** Override the provider's default base URL (e.g. point at a local proxy). */
- base_url: z.string().url().optional(),
-})
- .strict()
- .openapi('GoogleGeminiProviderModelEntry');
-
-/**
- * Custom OpenAI-compatible provider. Requires an explicit `base_url` since
- * there is no canonical endpoint.
- */
-const CustomProviderEntrySchema = ModelEntryBaseSchema.extend({
- provider: z.literal('custom'),
- /** Deployment-specific base URL — required. */
- base_url: z.string().url(),
- /** API format used by this endpoint. Only option today; defaults when absent. */
- api_format: z.literal('openai-chat-completions').optional(),
-})
- .strict()
- .openapi('CustomProviderModelEntry');
-
-export const ModelEntrySchema = z
- .discriminatedUnion('provider', [
- OpenAIProviderEntrySchema,
- AnthropicProviderEntrySchema,
- GoogleGeminiProviderEntrySchema,
- CustomProviderEntrySchema,
- ])
- .openapi('ModelEntry');
-
-export const ModelsFileSchema = z
- .object({
- models: z.array(ModelEntrySchema),
- })
- .strict()
- .superRefine((file, ctx) => {
- uniqueNames(file.models, ctx);
- uniqueEnvNames(file.models, ctx);
- });
-
-export const McpServerAuthSettingsSchema = z
- .discriminatedUnion('type', [z.object({ type: z.literal('dcr') })])
- .openapi('McpServerAuthSettings');
-
-export const McpServerEntrySchema = z
- .object({
- name: z.string().min(1),
- url: z.string().url(),
- auth: McpServerAuthSettingsSchema.optional(),
- })
- .strict();
-
-/**
- * `mcp_server.manifest` JSONB shape — the full mcp.yaml entry, including `name` (also kept as its
- * own DB column for the uniqueness index — duplicated, not split out, so the manifest blob always
- * round-trips the whole yaml entry as-is). Reuses `McpServerEntrySchema` directly rather than a
- * hand-written type, so the DB's stored shape can never drift from the yaml-validated one.
- */
-export const McpServerManifestSchema = McpServerEntrySchema;
-
-export const McpFileSchema = z
- .object({
- mcp_servers: z.array(McpServerEntrySchema),
- })
- .strict()
- .superRefine((file, ctx) => {
- uniqueNames(file.mcp_servers, ctx);
- uniqueEnvNames(file.mcp_servers, ctx);
- });
-
-export const SkillEntrySchema = z
- .object({
- name: z.string().min(1),
- // Public git repository containing the skill.
- url: z.string().url(),
- // Directory inside the repository containing SKILL.md. Repo root if omitted.
- path: z.string().min(1).optional(),
- // Branch, tag, or commit SHA to pin. Default branch if omitted.
- ref: z.string().min(1).optional(),
- // Shown to users and persisted in the selected skill mount for runtime prompting.
- description: z.string().min(1),
- })
- .strict()
- .openapi('SkillEntry');
-
-export const SkillsFileSchema = z
- .object({
- skills: z.array(SkillEntrySchema),
- })
- .strict()
- .superRefine((file, ctx) => {
- uniqueNames(file.skills, ctx);
- });
-
-export type ModelEntry = z.infer<typeof ModelEntrySchema>;
-export type McpServerAuthSettings = z.infer<typeof McpServerAuthSettingsSchema>;
-export type McpServerEntry = z.infer<typeof McpServerEntrySchema>;
-export type McpServerManifest = z.infer<typeof McpServerManifestSchema>;
-export type SkillEntry = z.infer<typeof SkillEntrySchema>;
diff --git a/packages/server/src/main.ts b/packages/server/src/main.ts
index e75600ba9..3befa2084 100644
--- a/packages/server/src/main.ts
+++ b/packages/server/src/main.ts
@@ -1,7 +1,6 @@
/**
- * Server entry point: validates config, migrates Postgres, loads the YAML
- * stores, wires the Postgres session store and starts the HTTP server.
- * Any config, migration, or store error aborts startup.
+ * Server entry point: validates config, migrates Postgres, wires DB stores
+ * and starts the HTTP server. Any config, migration, or store error aborts startup.
* SQLite migrations are packaged under dist/ but are not run at startup.
*/
import { serve } from '@hono/node-server';
@@ -16,12 +15,9 @@ try {
{ default: configuration },
{ createDb },
{ migrateToLatest },
- { ModelStore },
- { McpStore },
- { SkillStore },
{ Sessions, CancellationReason },
{ ActiveTurnRegistry },
- { createServerSandboxFactory },
+ { createServerSandboxProvider },
{ connectRedis },
{ RequestReplyExecutor, RequestReplyRouter },
{ PostgresSessionStore },
@@ -41,9 +37,6 @@ try {
import('./config'),
import('./db/postgres/client'),
import('./db/migratePostgres'),
- import('./legacy-registry-store/ModelStore'),
- import('./legacy-registry-store/McpStore'),
- import('./legacy-registry-store/SkillStore'),
import('@truefoundry/utils-core/agent-session'),
import('./runtime/activeTurns'),
import('./runtime/sandboxFactory'),
@@ -79,8 +72,8 @@ try {
const sessionStore = new PostgresSessionStore(db);
// Throws on malformed SANDBOX_SETTINGS; undefined when sandbox is not configured.
- const legacySkillStore = SkillStore.load();
- const sandboxFactory = createServerSandboxFactory({ logger });
+ const skillStore = new PostgresSkillStore(db);
+ const sandboxProvider = createServerSandboxProvider({ logger });
const activeTurns = new ActiveTurnRegistry();
let redis: RedisClientType | undefined;
@@ -94,22 +87,19 @@ try {
const eventSubscriptions = new EventSubscriptionRegistry<TurnStreamingEvent>(redis);
const app = createServerApp({
- modelStore: ModelStore.load(),
modelCatalog: ModelCatalog.load(),
modelProviderStore: new PostgresModelProviderStore(db),
mcpCatalog: McpCatalog.load(),
mcpServerStore: new PostgresMcpServerStore(db),
tokenStore: new PostgresOAuthTokenStore(db),
- mcpStore: McpStore.load(),
skillCatalog: SkillCatalog.load(),
- skillStore: new PostgresSkillStore(db),
+ skillStore,
sandboxCatalog: SandboxCatalog.load(),
sandboxProviderStore: new PostgresSandboxProviderStore(db),
- legacySkillStore,
sessionStore,
sessions: new Sessions({ sessionStore }),
activeTurns,
- ...(sandboxFactory ? { sandboxFactory } : {}),
+ ...(sandboxProvider ? { sandboxProvider } : {}),
redis,
requestReplyRouter,
eventSubscriptions,
diff --git a/packages/server/src/routes/legacyCapabilityRoutes.ts b/packages/server/src/routes/legacyCapabilityRoutes.ts
deleted file mode 100644
index be0806101..000000000
--- a/packages/server/src/routes/legacyCapabilityRoutes.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Legacy capabilities route (mounted at /api/v1/legacy/capabilities).
- * Driven by boot-time SANDBOX_SETTINGS / sandboxFactory — same shape the UI used
- * before GET /api/v1/capabilities gained skill support.
- */
-import { createRoute, z } from '@hono/zod-openapi';
-
-const GetLegacyCapabilitiesResponseSchema = z
- .object({
- data: z.object({
- sandbox: z.object({
- enabled: z.boolean().describe('Whether this server has a sandbox provider configured via SANDBOX_SETTINGS.'),
- }),
- }),
- })
- .openapi('GetLegacyCapabilitiesResponse');
-
-export const getLegacyCapabilitiesRoute = createRoute({
- method: 'get',
- path: '/',
- tags: ['Legacy Capabilities'],
- summary: 'Get server capabilities (legacy)',
- 'x-fern-sdk-group-name': ['legacy', 'server'],
- 'x-fern-sdk-method-name': 'get_capabilities',
- description:
- 'Report optional runtime capabilities from boot-time SANDBOX_SETTINGS. Prefer GET /api/v1/capabilities for new clients.',
- responses: {
- 200: {
- content: { 'application/json': { schema: GetLegacyCapabilitiesResponseSchema } },
- description: 'Server capabilities (legacy).',
- },
- },
-});
diff --git a/packages/server/src/routes/legacyMcpRoutes.ts b/packages/server/src/routes/legacyMcpRoutes.ts
deleted file mode 100644
index ebc28c7db..000000000
--- a/packages/server/src/routes/legacyMcpRoutes.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-import { createRoute, z } from '@hono/zod-openapi';
-import { McpServerEntrySchema } from '../legacy-registry-store/schemas';
-import { RequestErrorResponseSchema } from '../schemas/errors';
-
-const MCP_SERVERS_TAG = 'Legacy MCP Servers';
-
-// Extends the yaml-validation schema with a response-only field — `auth_status` isn't a valid
-// mcp.yaml key, so it's added here rather than on McpServerEntrySchema itself.
-const McpServerResponseSchema = McpServerEntrySchema.extend({
- auth_status: z
- .enum(['authenticated', 'authentication_required', 'not_required'])
- .describe(
- 'Passive check only: whether a stored, unexpired token exists. Never attempts a live refresh, ' +
- 'so an expired-but-refreshable token still reads as `authentication_required` here. ' +
- '`not_required` for servers without `auth` configured.',
- ),
-}).openapi('McpServerEntry');
-
-const ListMcpServersResponseSchema = z
- .object({
- data: z.array(McpServerResponseSchema),
- })
- .openapi('ListMcpServersResponse');
-
-export const listMcpServersRoute = createRoute({
- method: 'get',
- path: '/',
- tags: [MCP_SERVERS_TAG],
- summary: 'List MCP servers',
- description:
- 'MCP servers declared in mcp.yaml, each with a passive auth_status snapshot. Auth headers are ' +
- 'configured via env vars and never returned.',
- 'x-fern-sdk-group-name': ['legacy', 'mcp_servers'],
- 'x-fern-sdk-method-name': 'list',
- responses: {
- 200: {
- content: { 'application/json': { schema: ListMcpServersResponseSchema } },
- description: 'All configured MCP servers.',
- },
- },
-});
-
-// Tools are passed through verbatim from the MCP server's `tools/list`
-// response (name, description, inputSchema, outputSchema, annotations, ...),
-// so they are documented as opaque objects rather than a copied MCP schema —
-// the MCP spec owns the tool shape. The SDK's own ToolSchema can't be reused
-// here: it is Zod v4, while @hono/zod-openapi is Zod v3.
-const ListMcpToolsResponseSchema = z
- .object({
- data: z
- .array(z.record(z.unknown()))
- .describe('MCP `tools/list` entries, passed through verbatim from the MCP server.'),
- })
- .openapi('ListMcpToolsResponse');
-
-const McpServerNameParamsSchema = z.object({
- name: z.string().min(1).describe('MCP server name from mcp.yaml.'),
-});
-
-export const listMcpToolsRoute = createRoute({
- method: 'get',
- path: '/{name}/tools',
- tags: [MCP_SERVERS_TAG],
- summary: 'List tools of an MCP server',
- 'x-fern-sdk-group-name': ['legacy', 'mcp_servers'],
- 'x-fern-sdk-method-name': 'list_tools',
- description:
- 'All tools exposed by the given MCP server (non-paginated), as returned by the MCP `tools/list` call. No agent-spec tool selectors are applied — this is the raw server catalog.',
- request: {
- params: McpServerNameParamsSchema,
- },
- responses: {
- 200: {
- content: { 'application/json': { schema: ListMcpToolsResponseSchema } },
- description: 'All tools of the MCP server.',
- },
- 401: {
- content: { 'application/json': { schema: RequestErrorResponseSchema } },
- description: 'The MCP server requires authentication (configure MCP_HEADERS / MCP_{NAME}_HEADERS).',
- },
- 404: {
- content: { 'application/json': { schema: RequestErrorResponseSchema } },
- description: 'MCP server not declared in mcp.yaml.',
- },
- 502: {
- content: { 'application/json': { schema: RequestErrorResponseSchema } },
- description: 'The MCP server could not be reached or returned an error.',
- },
- },
-});
diff --git a/packages/server/src/routes/legacyModelRoutes.ts b/packages/server/src/routes/legacyModelRoutes.ts
deleted file mode 100644
index e0cb109dd..000000000
--- a/packages/server/src/routes/legacyModelRoutes.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { createRoute, z } from '@hono/zod-openapi';
-import { ModelEntrySchema } from '../legacy-registry-store/schemas';
-
-const ListLegacyModelsResponseSchema = z
- .object({
- data: z.array(ModelEntrySchema),
- })
- .openapi('ListLegacyModelsResponse');
-
-/** YAML-backed registry list; runtime still uses ModelStore for turns. */
-export const listLegacyModelsRoute = createRoute({
- method: 'get',
- path: '/',
- tags: ['Legacy Models'],
- summary: 'List models (models.yaml)',
- 'x-fern-sdk-group-name': ['legacy', 'models'],
- 'x-fern-sdk-method-name': 'list',
- description: 'Models declared in models.yaml — the registry the runtime still uses for turns.',
- responses: {
- 200: {
- content: { 'application/json': { schema: ListLegacyModelsResponseSchema } },
- description: 'All configured models.',
- },
- },
-});
diff --git a/packages/server/src/routes/legacySkillRoutes.ts b/packages/server/src/routes/legacySkillRoutes.ts
deleted file mode 100644
index 259c616ab..000000000
--- a/packages/server/src/routes/legacySkillRoutes.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { createRoute, z } from '@hono/zod-openapi';
-import { SkillEntrySchema } from '../legacy-registry-store/schemas';
-
-const ListSkillsResponseSchema = z
- .object({
- data: z.array(SkillEntrySchema),
- })
- .openapi('ListSkillsResponse');
-
-export const listSkillsRoute = createRoute({
- method: 'get',
- path: '/',
- tags: ['Legacy Skills'],
- summary: 'List skills',
- 'x-fern-sdk-group-name': ['legacy', 'skills'],
- 'x-fern-sdk-method-name': 'list',
- description: 'Agent skills declared in skills.yaml.',
- responses: {
- 200: {
- content: { 'application/json': { schema: ListSkillsResponseSchema } },
- description: 'All configured skills.',
- },
- },
-});
diff --git a/packages/server/src/routes/mcpServerRoutes.ts b/packages/server/src/routes/mcpServerRoutes.ts
index cd55fe339..833291b26 100644
--- a/packages/server/src/routes/mcpServerRoutes.ts
+++ b/packages/server/src/routes/mcpServerRoutes.ts
@@ -1,7 +1,7 @@
/**
* DB-backed MCP server route definitions.
* Admin routes mount at /api/v1/settings/mcp-servers; the chat list mounts at
- * /api/v1/mcp-servers. Legacy YAML stays under /api/v1/legacy/mcp-servers.
+ * /api/v1/mcp-servers.
*/
import { createRoute, z } from '@hono/zod-openapi';
import { RequestErrorResponseSchema } from '../schemas/errors';
diff --git a/packages/server/src/routes/sessionRoutes.ts b/packages/server/src/routes/sessionRoutes.ts
index adf830b2b..95cafd1e5 100644
--- a/packages/server/src/routes/sessionRoutes.ts
+++ b/packages/server/src/routes/sessionRoutes.ts
@@ -1,6 +1,7 @@
/**
- * Session route definitions (mounted at /api/v1/sessions). A session holds an
- * inline agent spec. Handlers are registered in apis/sessions.ts.
+ * Session route definitions.
+ * DB-backed routes mount at /api/v1/sessions.
+ * Handlers are registered in apis/sessions.ts.
*/
import { createRoute, z } from '@hono/zod-openapi';
import { RequestErrorResponseSchema } from '../schemas/errors';
diff --git a/packages/server/src/routes/skillRoutes.ts b/packages/server/src/routes/skillRoutes.ts
index 01dd63ba6..31ca0cc64 100644
--- a/packages/server/src/routes/skillRoutes.ts
+++ b/packages/server/src/routes/skillRoutes.ts
@@ -1,7 +1,7 @@
/**
* DB-backed skill route definitions.
* Admin routes mount at /api/v1/settings/skills; the chat list mounts at
- * /api/v1/skills. Legacy YAML stays under /api/v1/legacy/skills.
+ * /api/v1/skills.
*/
import { createRoute } from '@hono/zod-openapi';
import { RequestErrorResponseSchema } from '../schemas/errors';
diff --git a/packages/server/src/routes/turnRoutes.ts b/packages/server/src/routes/turnRoutes.ts
index de86bb919..4091eb211 100644
--- a/packages/server/src/routes/turnRoutes.ts
+++ b/packages/server/src/routes/turnRoutes.ts
@@ -1,7 +1,7 @@
/**
- * Turn route definitions (mounted at /api/v1/sessions). Creating a turn responds
- * with a Server-Sent Events stream; a running turn can be re-subscribed to
- * with resume support. Handlers are registered in apis/turns.ts.
+ * Turn route definitions.
+ * DB-backed routes mount at /api/v1/sessions.
+ * Handlers are registered in apis/turns.ts.
*/
import { createRoute, z } from '@hono/zod-openapi';
import { RequestErrorResponseSchema } from '../schemas/errors';
diff --git a/packages/server/src/runtime/dbSessionResources.ts b/packages/server/src/runtime/dbSessionResources.ts
new file mode 100644
index 000000000..395543015
--- /dev/null
+++ b/packages/server/src/runtime/dbSessionResources.ts
@@ -0,0 +1,199 @@
+/**
+ * DB-backed model/MCP/skill resolution for /api/v1/sessions admit and turns.
+ */
+import type { AgentSpec } from '@truefoundry/utils-core/agent-session';
+import type { GitSkill, VercelAIProviderConfig } from '@truefoundry/utils-core/core';
+import { HTTPException } from 'hono/http-exception';
+import type { IMcpServerStore } from '../db/mcpServerStore';
+import type { IModelProviderStore } from '../db/modelProviderStore';
+import type { ISkillStore } from '../db/skillStore';
+import { resolveConfiguredMcpRequestHeaders } from '../schemas/mcpServer';
+
+/** Split `provider/model` FQN. Returns undefined when the shape is not exactly one slash. */
+export function parseModelFqn(name: string): { providerName: string; modelName: string } | undefined {
+ const slash = name.indexOf('/');
+ if (slash <= 0 || slash === name.length - 1) {
+ return undefined;
+ }
+ if (name.includes('/', slash + 1)) {
+ return undefined;
+ }
+ return { providerName: name.slice(0, slash), modelName: name.slice(slash + 1) };
+}
+
+/**
+ * Load turn-ready LLM config for a DB-configured FQN (`provider/model`).
+ * Missing provider/model → HTTPException(400) (e.g. deleted after admit).
+ * Malformed FQN after admit is an invariant → plain Error (500).
+ */
+export async function getDbProviderConfig({
+ tenant_id,
+ name,
+ store,
+}: {
+ tenant_id: string;
+ name: string;
+ store: IModelProviderStore;
+}): Promise<VercelAIProviderConfig> {
+ // AgentSpecSchema already required provider/model; failure here is corrupt stored spec.
+ const parsed = parseModelFqn(name);
+ if (parsed === undefined) {
+ throw new Error(`Model name must be a fully qualified "provider/model": ${name}`);
+ }
+ const provider = await store.getProvider({ tenant_id, name: parsed.providerName });
+ if (provider === undefined) {
+ throw new HTTPException(400, {
+ message: `Unknown model "${name}" — provider not configured`,
+ });
+ }
+ const model = provider.manifest.models.find(entry => entry.name === parsed.modelName);
+ if (model === undefined) {
+ throw new HTTPException(400, {
+ message: `Unknown model "${name}" — not configured on provider`,
+ });
+ }
+ return {
+ provider: provider.manifest.type,
+ name,
+ model_id: model.model_id,
+ base_url: provider.manifest.base_url,
+ apiKey: provider.manifest.auth.api_key,
+ headers: {},
+ };
+}
+
+/**
+ * Load MCP url + request headers for a DB-configured server name.
+ * Throws HTTPException(400) if the server is not registered.
+ */
+export async function getDbMcpConnection({
+ tenant_id,
+ name,
+ store,
+}: {
+ tenant_id: string;
+ name: string;
+ store: IMcpServerStore;
+}): Promise<{ url: string; headers: Record<string, string> }> {
+ const record = await store.getServer({ tenant_id, name });
+ if (record === undefined) {
+ throw new HTTPException(400, {
+ message: `Unknown MCP server "${name}" — not configured`,
+ });
+ }
+ return {
+ url: record.manifest.url,
+ headers: resolveConfiguredMcpRequestHeaders(record.manifest),
+ };
+}
+
+/**
+ * Expand agent_spec skill names into git mounts from the skill store.
+ * Wire url/path/ref/description on the request are ignored — the DB row wins.
+ * Throws HTTPException(400) if any name is not registered.
+ */
+export async function resolveDbGitSkills({
+ tenant_id,
+ skills,
+ store,
+}: {
+ tenant_id: string;
+ skills: readonly { name: string }[];
+ store: ISkillStore;
+}): Promise<GitSkill[]> {
+ const resolved: GitSkill[] = [];
+ for (const skill of skills) {
+ const record = await store.getSkill({ tenant_id, name: skill.name });
+ if (record === undefined) {
+ throw new HTTPException(400, {
+ message: `Unknown skill "${skill.name}" — not configured`,
+ });
+ }
+ resolved.push({
+ name: record.manifest.name,
+ description: record.manifest.description,
+ url: record.manifest.url,
+ path: record.manifest.path ?? '',
+ ref: record.manifest.ref,
+ });
+ }
+ return resolved;
+}
+
+/**
+ * Cross-checks an AgentSpec against DB-configured models / MCP / skills and
+ * sandbox capability. Throws HTTPException: 400 unknown refs, 422 missing sandbox.
+ * Skills are admitted by name only; mounts expand at turn time.
+ */
+export async function validateAgentSpecDb({
+ spec,
+ tenant_id,
+ modelProviderStore,
+ mcpServerStore,
+ skillStore,
+ sandboxSupported,
+}: {
+ spec: AgentSpec;
+ tenant_id: string;
+ modelProviderStore: IModelProviderStore;
+ mcpServerStore: IMcpServerStore;
+ skillStore: ISkillStore;
+ sandboxSupported: boolean;
+}): Promise<void> {
+ // FQN shape is enforced by AgentSpecSchema; parse failure here is an invariant.
+ const parsed = parseModelFqn(spec.model.name);
+ if (parsed === undefined) {
+ throw new Error(`Model name must be a fully qualified "provider/model": ${spec.model.name}`);
+ }
+ const provider = await modelProviderStore.getProvider({ tenant_id, name: parsed.providerName });
+ if (provider === undefined) {
+ throw new HTTPException(400, {
+ message: `Unknown model "${spec.model.name}" — provider not configured`,
+ });
+ }
+ const model = provider.manifest.models.find(entry => entry.name === parsed.modelName);
+ if (model === undefined) {
+ throw new HTTPException(400, {
+ message: `Unknown model "${spec.model.name}" — not configured on provider`,
+ });
+ }
+ const reasoningEffort = spec.model.params?.reasoning_effort;
+ if (reasoningEffort !== undefined) {
+ const efforts = model.properties.reasoning_efforts;
+ if (!efforts?.includes(reasoningEffort)) {
+ throw new HTTPException(400, {
+ message: efforts
+ ? `Reasoning effort "${reasoningEffort}" is not supported by model "${spec.model.name}"`
+ : `Model "${spec.model.name}" does not support configurable reasoning effort`,
+ });
+ }
+ }
+
+ for (const server of spec.mcp_servers ?? []) {
+ const record = await mcpServerStore.getServer({ tenant_id, name: server.name });
+ if (record === undefined) {
+ throw new HTTPException(400, {
+ message: `Unknown MCP server "${server.name}" — not configured`,
+ });
+ }
+ }
+
+ for (const skill of spec.skills ?? []) {
+ const record = await skillStore.getSkill({ tenant_id, name: skill.name });
+ if (record === undefined) {
+ throw new HTTPException(400, {
+ message: `Unknown skill "${skill.name}" — not configured`,
+ });
+ }
+ }
+
+ const wantsSandbox = spec.config?.sandbox?.enabled === true;
+ const hasSkills = (spec.skills?.length ?? 0) > 0;
+ if ((wantsSandbox || hasSkills) && !sandboxSupported) {
+ throw new HTTPException(422, {
+ message: hasSkills
+ ? 'skills require a sandbox provider — set SANDBOX_SETTINGS (and SANDBOX_API_KEY)'
+ : 'sandbox is enabled in the agent spec but this server has no sandbox provider configured — set SANDBOX_SETTINGS (and SANDBOX_API_KEY)',
+ });
+ }
+}
diff --git a/packages/server/src/runtime/sandboxFactory.ts b/packages/server/src/runtime/sandboxFactory.ts
index 6f65acb48..348a5a407 100644
--- a/packages/server/src/runtime/sandboxFactory.ts
+++ b/packages/server/src/runtime/sandboxFactory.ts
@@ -1,19 +1,18 @@
/**
- * Boot-time sandbox composition: parses `SANDBOX_SETTINGS` into the harness's
- * provider-settings union, builds the provider once, and returns the per-run
- * {@link TurnSandboxFactory} handed to TurnResourceResolver. Returns undefined
- * when the server has no sandbox configuration — admission then rejects specs
- * with `config.sandbox.enabled`.
+ * Boot-time sandbox provider from `SANDBOX_SETTINGS`, plus a shared Sandbox
+ * builder that takes already-resolved git skill mounts (no skill store).
*
* Called from main.ts so a malformed SANDBOX_SETTINGS aborts startup instead
- * of failing mid-turn.
+ * of failing mid-turn. Skill expansion stays in the DB turn resolvers.
*/
-import type { TurnSandboxFactory } from '@truefoundry/utils-core/agent-session';
import {
createSandboxProvider,
Sandbox,
SandboxProviderSettingsSchema,
SkillMounter,
+ type AgentTracing,
+ type GitSkill,
+ type SandboxProvider,
} from '@truefoundry/utils-core/core';
import type { Logger } from 'winston';
import { ZodError } from 'zod';
@@ -47,10 +46,38 @@ function parseSandboxSettings(rawJson: string) {
}
/**
- * Builds the per-run sandbox factory from the environment, or undefined when
- * sandbox is not configured. Throws on any misconfiguration.
+ * Builds a Sandbox for one turn from resolved git mounts. Callers expand
+ * skills from ISkillStore before invoking this.
*/
-export function createServerSandboxFactory(deps: { logger: Logger }): TurnSandboxFactory | undefined {
+export function buildTurnSandbox(input: {
+ provider: SandboxProvider;
+ logger: Logger;
+ gitSkills: readonly GitSkill[];
+ fileDownloadEnabled: boolean;
+ existingSandboxId?: string | undefined;
+ tracing: AgentTracing;
+}): Sandbox {
+ const skillMounter = input.gitSkills.length > 0 ? new SkillMounter([...input.gitSkills]) : undefined;
+ return new Sandbox({
+ provider: input.provider,
+ existingSandboxId: input.existingSandboxId,
+ fileDownloadEnabled: input.fileDownloadEnabled,
+ blockDestructiveToolsInCodeMode: true,
+ // Sandbox reads its tenant from TFY_TENANT_NAME (see Sandbox constructor)
+ // for the ownership check against provider-created sandbox ids
+ // (`<tenant>.<uuid>`). Must match the tenantName given to the provider.
+ execExtraEnv: { TFY_TENANT_NAME: TENANT_ID },
+ ...(skillMounter ? { skillMounter } : {}),
+ tracing: input.tracing,
+ logger: input.logger,
+ });
+}
+
+/**
+ * Builds the shared SandboxProvider, or undefined when sandbox is not configured.
+ * Throws on any misconfiguration.
+ */
+export function createServerSandboxProvider(deps: { logger: Logger }): SandboxProvider | undefined {
if (configuration.SANDBOX_SETTINGS === undefined) {
if (configuration.SANDBOX_API_KEY !== undefined) {
throw new Error(
@@ -63,42 +90,11 @@ export function createServerSandboxFactory(deps: { logger: Logger }): TurnSandbo
const settings = parseSandboxSettings(configuration.SANDBOX_SETTINGS);
const logger = deps.logger.child({ module: 'sandboxFactory' });
- const provider = createSandboxProvider({
+ return createSandboxProvider({
settings,
tenantName: TENANT_ID,
fileMaxBytes: configuration.SANDBOX_FILE_MAX_BYTES,
previewUrlExpirySeconds: configuration.SANDBOX_PREVIEW_URL_EXPIRY_SECONDS,
logger,
});
-
- return ({ spec, existingSandboxId, tracing }) => {
- const skills = spec.skills ?? [];
- const skillMounter =
- skills.length > 0
- ? new SkillMounter(
- skills.map(skill => ({
- name: skill.name,
- description: skill.description,
- url: skill.url,
- path: skill.path ?? '',
- ref: skill.ref,
- })),
- )
- : undefined;
- return Promise.resolve(
- new Sandbox({
- provider,
- existingSandboxId,
- fileDownloadEnabled: spec.config?.sandbox?.file_downloads ?? false,
- blockDestructiveToolsInCodeMode: true,
- // Sandbox reads its tenant from TFY_TENANT_NAME (see Sandbox constructor)
- // for the ownership check against provider-created sandbox ids
- // (`<tenant>.<uuid>`). Must match the tenantName given to the provider.
- execExtraEnv: { TFY_TENANT_NAME: TENANT_ID },
- ...(skillMounter ? { skillMounter } : {}),
- tracing,
- logger,
- }),
- );
- };
}
diff --git a/packages/server/src/schemas/mcpServer.ts b/packages/server/src/schemas/mcpServer.ts
index 74107073b..fd3f24773 100644
--- a/packages/server/src/schemas/mcpServer.ts
+++ b/packages/server/src/schemas/mcpServer.ts
@@ -5,8 +5,7 @@
*
* Auth mirrors gateway MCP header/DCR shapes in reduced form: `header` stores
* shared request headers on the row; `dcr` is the OAuth/DCR stub until real
- * token exchange lands. Legacy YAML still uses MCP_HEADERS /
- * MCP_{NAME}_HEADERS env vars — not this schema.
+ * token exchange lands.
*/
import { z } from '@hono/zod-openapi';
import { NameSchema } from './common';
@@ -96,8 +95,7 @@ export type McpServerReadEntry = z.infer<typeof McpServerReadEntrySchema>;
/**
* Headers for live MCP calls against a configured server.
- * Only `auth.type === 'header'` contributes; DCR uses tokens later, not env
- * MCP_HEADERS (those remain on the legacy YAML path).
+ * Only `auth.type === 'header'` contributes; DCR uses tokens later.
*/
export function resolveConfiguredMcpRequestHeaders(manifest: McpServerManifest): Record<string, string> {
if (manifest.auth?.type === 'header') {
diff --git a/packages/server/src/schemas/skill.ts b/packages/server/src/schemas/skill.ts
index 60b9ba1a4..c80bf9b8b 100644
--- a/packages/server/src/schemas/skill.ts
+++ b/packages/server/src/schemas/skill.ts
@@ -2,10 +2,9 @@
* Configured skill domain + wire schemas: the `skill.manifest` JSONB document
* and admin/chat list projections. Catalog file schemas live in skillCatalog.ts.
*
- * Git field rules mirror harness SkillMount (GitHub/GitLab HTTPS url, path/ref
- * constraints) so settings documents stay mount-compatible. Identity uses
- * NameSchema like model providers / MCP servers. Legacy YAML SkillEntry stays
- * on legacy-registry-store — not this schema.
+ * Git field rules mirror harness git skill mounts (GitHub/GitLab HTTPS url,
+ * path/ref constraints) so settings documents stay mount-compatible. Identity
+ * uses NameSchema like model providers / MCP servers.
*/
import { z } from '@hono/zod-openapi';
import { NameSchema } from './common';
@@ -41,8 +40,7 @@ export const SkillGitPathSchema = z
.describe('Path to the skill directory within the repository. Omit to use the repository root.');
/**
- * Shared with catalog presets. Optional on configured/catalog rows; composer
- * defaults omitted refs to HEAD when building a SkillMount.
+ * Shared with catalog presets. Required on configured skills (no silent HEAD default).
*/
export const SkillGitRefSchema = z
.string()
@@ -66,7 +64,7 @@ export const SkillManifestObjectSchema = z
name: NameSchema,
url: SkillGitUrlSchema,
path: SkillGitPathSchema.optional(),
- ref: SkillGitRefSchema.optional(),
+ ref: SkillGitRefSchema,
description: SkillDescriptionSchema,
})
.strict();
diff --git a/packages/server/src/schemas/skillCatalog.ts b/packages/server/src/schemas/skillCatalog.ts
index 24ac12363..caa64358b 100644
--- a/packages/server/src/schemas/skillCatalog.ts
+++ b/packages/server/src/schemas/skillCatalog.ts
@@ -19,7 +19,7 @@ export const CatalogSkillSchema = z
name: NameSchema,
url: SkillGitUrlSchema,
path: SkillGitPathSchema.optional(),
- ref: SkillGitRefSchema.optional(),
+ ref: SkillGitRefSchema,
description: SkillDescriptionSchema,
})
.strict()
diff --git a/packages/server/tests/unit/apis/capabilities.test.ts b/packages/server/tests/unit/apis/capabilities.test.ts
index 4539a6782..c24ddf257 100644
--- a/packages/server/tests/unit/apis/capabilities.test.ts
+++ b/packages/server/tests/unit/apis/capabilities.test.ts
@@ -1,23 +1,10 @@
import { createCapabilitiesRouter } from '../../../src/apis/capabilities';
-import { createLegacyCapabilitiesRouter } from '../../../src/apis/legacyCapabilities';
import { migrateSqliteToLatest } from '../../../src/db/migrateSqlite';
import { createSqliteDb } from '../../../src/db/sqlite/client';
import { SqliteSandboxProviderStore } from '../../../src/db/sqlite/sandbox-provider-store/SqliteSandboxProviderStore';
describe('capabilities routers', () => {
- it('legacy capabilities report boot-time sandboxEnabled', async () => {
- const enabled = createLegacyCapabilitiesRouter({ sandboxEnabled: true });
- const enabledRes = await enabled.request('/');
- expect(enabledRes.status).toBe(200);
- expect(await enabledRes.json()).toEqual({ data: { sandbox: { enabled: true } } });
-
- const disabled = createLegacyCapabilitiesRouter({ sandboxEnabled: false });
- const disabledRes = await disabled.request('/');
- expect(disabledRes.status).toBe(200);
- expect(await disabledRes.json()).toEqual({ data: { sandbox: { enabled: false } } });
- });
-
- it('new capabilities derive sandbox and skill from the store', async () => {
+ it('capabilities derive sandbox and skill from the store', async () => {
const db = createSqliteDb(':memory:');
await migrateSqliteToLatest(db);
const store = new SqliteSandboxProviderStore(db);
diff --git a/packages/server/tests/unit/apis/deletedSessionCrud.test.ts b/packages/server/tests/unit/apis/deletedSessionCrud.test.ts
index a639d4109..c8af31d56 100644
--- a/packages/server/tests/unit/apis/deletedSessionCrud.test.ts
+++ b/packages/server/tests/unit/apis/deletedSessionCrud.test.ts
@@ -1,23 +1,30 @@
import { OpenAPIHono } from '@hono/zod-openapi';
-import { InMemorySessionStore, Sessions } from '@truefoundry/utils-core/agent-session';
+import { Sessions } from '@truefoundry/utils-core/agent-session';
import { RequestReplyRouter } from '@truefoundry/utils-core/request-reply';
import { createClient } from 'redis';
import { createLogger } from 'winston';
import { createSessionsRouter, TENANT_ID } from '../../../src/apis/sessions';
import { createTurnsRouter } from '../../../src/apis/turns';
-import { McpStore } from '../../../src/legacy-registry-store/McpStore';
-import { ModelStore } from '../../../src/legacy-registry-store/ModelStore';
+import { migrateSqliteToLatest } from '../../../src/db/migrateSqlite';
+import { createSqliteDb } from '../../../src/db/sqlite/client';
+import { SqliteMcpServerStore } from '../../../src/db/sqlite/mcp-server-store/SqliteMcpServerStore';
+import { SqliteModelProviderStore } from '../../../src/db/sqlite/model-provider-store/SqliteModelProviderStore';
+import { SqliteSessionStore } from '../../../src/db/sqlite/session-store/SqliteSessionStore';
+import { SqliteSkillStore } from '../../../src/db/sqlite/skill-store/SqliteSkillStore';
import { ActiveTurnRegistry } from '../../../src/runtime/activeTurns';
import { EventSubscriptionRegistry } from '../../../src/runtime/event-subscription/index.js';
import { ListSessionsResponseSchema } from '../../../src/schemas/session';
describe('public CRUD after session deletion', () => {
it('returns not found for session and turn operations', async () => {
- const sessionStore = new InMemorySessionStore();
+ const db = createSqliteDb(':memory:');
+ await migrateSqliteToLatest(db);
+ const sessionStore = new SqliteSessionStore(db);
const sessions = new Sessions({ sessionStore });
const activeTurns = new ActiveTurnRegistry();
- const modelStore = new ModelStore([]);
- const mcpStore = new McpStore([]);
+ const modelProviderStore = new SqliteModelProviderStore(db);
+ const mcpServerStore = new SqliteMcpServerStore(db);
+ const skillStore = new SqliteSkillStore(db);
const app = new OpenAPIHono();
app.route(
@@ -26,8 +33,9 @@ describe('public CRUD after session deletion', () => {
sessions,
sessionStore,
activeTurns,
- modelStore,
- mcpStore,
+ modelProviderStore,
+ mcpServerStore,
+ skillStore,
sandboxSupported: false,
redis: createClient(),
requestReplyRouter: new RequestReplyRouter(),
@@ -39,8 +47,9 @@ describe('public CRUD after session deletion', () => {
sessions,
sessionStore,
activeTurns,
- modelStore,
- mcpStore,
+ modelProviderStore,
+ mcpServerStore,
+ skillStore,
eventSubscriptions: new EventSubscriptionRegistry(undefined),
logger: createLogger({ silent: true }),
}),
@@ -50,7 +59,7 @@ describe('public CRUD after session deletion', () => {
tenant_id: TENANT_ID,
session_id: 's1',
agent_spec: {
- model: { name: 'test-model' },
+ model: { name: 'test-provider/test-model' },
instructions: 'test',
},
custom: null,
diff --git a/packages/server/tests/unit/apis/turnStreamAfterDelete.test.ts b/packages/server/tests/unit/apis/turnStreamAfterDelete.test.ts
index b4478a714..3c4ad6cd4 100644
--- a/packages/server/tests/unit/apis/turnStreamAfterDelete.test.ts
+++ b/packages/server/tests/unit/apis/turnStreamAfterDelete.test.ts
@@ -1,10 +1,14 @@
import { OpenAPIHono } from '@hono/zod-openapi';
import type { Sessions } from '@truefoundry/utils-core/agent-session';
-import { InMemorySessionStore, TurnNotFoundError } from '@truefoundry/utils-core/agent-session';
+import { TurnNotFoundError } from '@truefoundry/utils-core/agent-session';
import { createLogger } from 'winston';
import { createTurnsRouter } from '../../../src/apis/turns';
-import { McpStore } from '../../../src/legacy-registry-store/McpStore';
-import { ModelStore } from '../../../src/legacy-registry-store/ModelStore';
+import { migrateSqliteToLatest } from '../../../src/db/migrateSqlite';
+import { createSqliteDb } from '../../../src/db/sqlite/client';
+import { SqliteMcpServerStore } from '../../../src/db/sqlite/mcp-server-store/SqliteMcpServerStore';
+import { SqliteModelProviderStore } from '../../../src/db/sqlite/model-provider-store/SqliteModelProviderStore';
+import { SqliteSessionStore } from '../../../src/db/sqlite/session-store/SqliteSessionStore';
+import { SqliteSkillStore } from '../../../src/db/sqlite/skill-store/SqliteSkillStore';
import { ActiveTurnRegistry } from '../../../src/runtime/activeTurns';
import { EventSubscriptionRegistry } from '../../../src/runtime/event-subscription/index.js';
@@ -17,9 +21,29 @@ describe('turn SSE after session deletion', () => {
return logger;
}) as typeof logger.warn;
+ const db = createSqliteDb(':memory:');
+ await migrateSqliteToLatest(db);
+ const modelProviderStore = new SqliteModelProviderStore(db);
+ await modelProviderStore.upsertProvider({
+ tenant_id: 'default',
+ name: 'test-provider',
+ manifest: {
+ type: 'openai',
+ auth: { api_key: 'sk-test' },
+ models: [
+ {
+ model_id: 'test-model',
+ name: 'test-model',
+ properties: { context_length: 128000, max_output_tokens: 4096 },
+ },
+ ],
+ },
+ });
+
const sessions = {
get: () =>
Promise.resolve({
+ agent_spec: { model: { name: 'test-provider/test-model' } },
record: { last_turn_id: null },
createTurn: () =>
Promise.resolve({
@@ -36,10 +60,11 @@ describe('turn SSE after session deletion', () => {
'/',
createTurnsRouter({
sessions,
- sessionStore: new InMemorySessionStore(),
+ sessionStore: new SqliteSessionStore(db),
activeTurns: new ActiveTurnRegistry(),
- modelStore: new ModelStore([]),
- mcpStore: new McpStore([]),
+ modelProviderStore,
+ mcpServerStore: new SqliteMcpServerStore(db),
+ skillStore: new SqliteSkillStore(db),
eventSubscriptions: new EventSubscriptionRegistry(undefined),
logger,
}),