The open-source agent harness - the runtime layer that turns an LLM into a working agent.
AGE-1704: Move catalog YAML out of src/ into packages/server/catalog (#128)
Bhavesh Patel5a7d9fb21a73
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 1e3c81421..9583b7650 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -69,6 +69,7 @@ jobs:store:- 'packages/server/src/db/**'- 'packages/server/src/catalog/**'+ - 'packages/server/catalog/**'- 'packages/server/tsup.config.ts'- 'packages/server/tests/db/**'- 'packages/server/jest.store.postgres.config.cjs'diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 371ed079a..c0ba5291a 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -177,7 +177,7 @@ Open [http://localhost:8791](http://localhost:8791). Credentials come from `pack## Generated code — do not edit by hand- [`packages/sdk`](packages/sdk) and [`.github/fern/openapi/openapi.json`](.github/fern/openapi/openapi.json) are generated by [Fern](https://buildwithfern.com) and committed. Edit route handlers under `packages/server/src/routes/` instead; CI regenerates the outputs. To regenerate locally (Docker required): `pnpm sdk:generate`.-- Catalog YAML files under `packages/server/src/catalog/` are inlined at build time by `build:gen` scripts.+- Catalog YAML files under `packages/server/catalog/` are inlined at build time by `build:gen` scripts.## Server entry pointsdiff --git a/packages/server/.env.example b/packages/server/.env.exampleindex e12bc78f6..597d1b5af 100644--- a/packages/server/.env.example+++ b/packages/server/.env.example@@ -14,19 +14,19 @@PORT=8790## 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.+## When unset, the catalog inlined at build time (catalog/model-catalog.yaml) is used.# MODEL_CATALOG_PATH=/path/to/model-catalog.yaml## Optional override for the MCP catalog YAML (GET /settings/mcp-servers/catalog).-## When unset, the catalog inlined at build time (src/catalog/mcp-catalog.yaml) is used.+## When unset, the catalog inlined at build time (catalog/mcp-catalog.yaml) is used.# MCP_CATALOG_PATH=/path/to/mcp-catalog.yaml## Optional override for the skill catalog YAML (GET /settings/skills/catalog).-## When unset, the catalog inlined at build time (src/catalog/skill-catalog.yaml) is used.+## When unset, the catalog inlined at build time (catalog/skill-catalog.yaml) is used.# SKILL_CATALOG_PATH=/path/to/skill-catalog.yaml## Optional override for the sandbox catalog YAML (GET /settings/sandbox-providers/catalog).-## When unset, the catalog inlined at build time (src/catalog/sandbox-catalog.yaml) is used.+## When unset, the catalog inlined at build time (catalog/sandbox-catalog.yaml) is used.# SANDBOX_CATALOG_PATH=/path/to/sandbox-catalog.yaml## Frontend build the server serves alongside the API. Optional; defaults todiff --git a/packages/server/src/catalog/mcp-catalog.yaml b/packages/server/catalog/mcp-catalog.yamlsimilarity index 100%rename from packages/server/src/catalog/mcp-catalog.yamlrename to packages/server/catalog/mcp-catalog.yamldiff --git a/packages/server/src/catalog/model-catalog.yaml b/packages/server/catalog/model-catalog.yamlsimilarity index 100%rename from packages/server/src/catalog/model-catalog.yamlrename to packages/server/catalog/model-catalog.yamldiff --git a/packages/server/src/catalog/sandbox-catalog.yaml b/packages/server/catalog/sandbox-catalog.yamlsimilarity index 100%rename from packages/server/src/catalog/sandbox-catalog.yamlrename to packages/server/catalog/sandbox-catalog.yamldiff --git a/packages/server/src/catalog/skill-catalog.yaml b/packages/server/catalog/skill-catalog.yamlsimilarity index 100%rename from packages/server/src/catalog/skill-catalog.yamlrename to packages/server/catalog/skill-catalog.yamldiff --git a/packages/server/package.json b/packages/server/package.jsonindex 055044f0f..21d9e8f35 100644--- a/packages/server/package.json+++ b/packages/server/package.json@@ -12,7 +12,7 @@],"scripts": {"build:frontend-assets": "node scripts/copy-frontend.mjs",- "build:gen:watch": "node --watch-path=src/catalog/model-catalog.yaml --watch-path=src/catalog/mcp-catalog.yaml --watch-path=src/catalog/skill-catalog.yaml --watch-path=src/catalog/sandbox-catalog.yaml scripts/generate-catalog.mjs",+ "build:gen:watch": "node --watch-path=catalog/model-catalog.yaml --watch-path=catalog/mcp-catalog.yaml --watch-path=catalog/skill-catalog.yaml --watch-path=catalog/sandbox-catalog.yaml scripts/generate-catalog.mjs","build:gen": "node scripts/generate-catalog.mjs","build:clean": "rm -rf dist","build": "pnpm run build:gen && tsc --noEmit && pnpm run build:clean && tsup && chmod +x dist/cli.js && pnpm run build:frontend-assets",diff --git a/packages/server/scripts/generate-catalog.mjs b/packages/server/scripts/generate-catalog.mjsindex 729aad71c..cba9c04dc 100644--- a/packages/server/scripts/generate-catalog.mjs+++ b/packages/server/scripts/generate-catalog.mjs@@ -1,6 +1,5 @@/**- * Inlines model-catalog.yaml, mcp-catalog.yaml, skill-catalog.yaml, and- * sandbox-catalog.yaml into generated TS modules so ModelCatalog / McpCatalog /+ * Inlines catalog/*.yaml into generated TS modules so ModelCatalog / McpCatalog /* SkillCatalog / SandboxCatalog can load shipped catalogs with no loose YAML* beside the bundle. Plain generated `.ts` files work unchanged across tsup and tsx.*@@ -14,7 +13,7 @@ import { fileURLToPath } from 'node:url';const root = join(dirname(fileURLToPath(import.meta.url)), '..');function writeShippedCatalog(yamlFileName, exportName, outFileName) {- const yaml = readFileSync(join(root, 'src/catalog', yamlFileName), 'utf-8');+ const yaml = readFileSync(join(root, 'catalog', yamlFileName), 'utf-8');const out = `// AUTO-GENERATED by scripts/generate-catalog.mjs — do not edit.export const ${exportName} = ${JSON.stringify(yaml)} as const;`;