From 4a6a3b5e99ef76037854e47e3b8028edcf4043df Mon Sep 17 00:00:00 2001 From: fishxcode Date: Wed, 25 Nov 2026 12:23:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(agent):=20=E8=A1=A5=E9=BD=90=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=AB=99=20agent=20readiness=20=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Vercel 支持首页 Accept: text/markdown 协商并声明 Vary\n- 补齐 ai-catalog/agent-card/agent-skills/mcp/poppy 的 .json 别名\n- 修正 protected resource 与 agent_auth.skill 元数据\n- 强制 well-known 返回 application/json --- src/app/.well-known/agent-card.json/route.ts | 3 +++ .../agent-skills/index.json/route.ts | 3 +++ src/app/.well-known/ai-catalog.json/route.ts | 3 +++ .../.well-known/mcp/server-card.json/route.ts | 3 +++ .../oauth-authorization-server/route.ts | 2 +- .../oauth-protected-resource/route.ts | 2 +- .../.well-known/openid-configuration/route.ts | 2 +- src/app/.well-known/poppy.json/route.ts | 3 +++ .../.well-known/skills/index.json/route.ts | 3 +++ vercel.json | 21 ++++++++++++++++++- 10 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 src/app/.well-known/agent-card.json/route.ts create mode 100644 src/app/.well-known/agent-skills/index.json/route.ts create mode 100644 src/app/.well-known/ai-catalog.json/route.ts create mode 100644 src/app/.well-known/mcp/server-card.json/route.ts create mode 100644 src/app/.well-known/poppy.json/route.ts create mode 100644 src/app/.well-known/skills/index.json/route.ts diff --git a/src/app/.well-known/agent-card.json/route.ts b/src/app/.well-known/agent-card.json/route.ts new file mode 100644 index 0000000..67bab83 --- /dev/null +++ b/src/app/.well-known/agent-card.json/route.ts @@ -0,0 +1,3 @@ +export { GET } from '../agent-card/route'; + +export const dynamic = 'force-static'; diff --git a/src/app/.well-known/agent-skills/index.json/route.ts b/src/app/.well-known/agent-skills/index.json/route.ts new file mode 100644 index 0000000..bbc4077 --- /dev/null +++ b/src/app/.well-known/agent-skills/index.json/route.ts @@ -0,0 +1,3 @@ +export { GET } from '../index/route'; + +export const dynamic = 'force-static'; diff --git a/src/app/.well-known/ai-catalog.json/route.ts b/src/app/.well-known/ai-catalog.json/route.ts new file mode 100644 index 0000000..d68d947 --- /dev/null +++ b/src/app/.well-known/ai-catalog.json/route.ts @@ -0,0 +1,3 @@ +export { GET } from '../ai-catalog/route'; + +export const dynamic = 'force-static'; diff --git a/src/app/.well-known/mcp/server-card.json/route.ts b/src/app/.well-known/mcp/server-card.json/route.ts new file mode 100644 index 0000000..2e3257f --- /dev/null +++ b/src/app/.well-known/mcp/server-card.json/route.ts @@ -0,0 +1,3 @@ +export { GET } from '../server-card/route'; + +export const dynamic = 'force-static'; diff --git a/src/app/.well-known/oauth-authorization-server/route.ts b/src/app/.well-known/oauth-authorization-server/route.ts index a93e83e..d86dc16 100644 --- a/src/app/.well-known/oauth-authorization-server/route.ts +++ b/src/app/.well-known/oauth-authorization-server/route.ts @@ -1,6 +1,6 @@ export const dynamic = 'force-static'; -const BODY = "{\n \"issuer\": \"https://docs.fishxcode.com\",\n \"authorization_endpoint\": \"https://fishxcode.com/console\",\n \"token_endpoint\": \"https://fishxcode.com/console\",\n \"jwks_uri\": \"https://fishxcode.com/.well-known/jwks.json\",\n \"response_types_supported\": [\n \"code\"\n ],\n \"grant_types_supported\": [\n \"authorization_code\",\n \"client_credentials\"\n ],\n \"subject_types_supported\": [\n \"public\"\n ],\n \"id_token_signing_alg_values_supported\": [\n \"RS256\"\n ],\n \"scopes_supported\": [\n \"openid\",\n \"profile\",\n \"email\",\n \"models:read\",\n \"usage:read\"\n ],\n \"token_endpoint_auth_methods_supported\": [\n \"client_secret_post\"\n ],\n \"agent_auth\": {\n \"skill\": \"auth.md\",\n \"register_uri\": \"https://fishxcode.com/register?aff=9CTW\",\n \"identity_types_supported\": [\n \"anonymous\"\n ],\n \"anonymous\": {\n \"credential_types_supported\": [\n \"api_key\"\n ]\n },\n \"claim_uri\": \"https://fishxcode.com/console\",\n \"revocation_uri\": \"https://fishxcode.com/console\"\n }\n}"; +const BODY = "{\n \"issuer\": \"https://docs.fishxcode.com\",\n \"authorization_endpoint\": \"https://fishxcode.com/console\",\n \"token_endpoint\": \"https://fishxcode.com/console\",\n \"jwks_uri\": \"https://fishxcode.com/.well-known/jwks.json\",\n \"response_types_supported\": [\n \"code\"\n ],\n \"grant_types_supported\": [\n \"authorization_code\",\n \"client_credentials\"\n ],\n \"subject_types_supported\": [\n \"public\"\n ],\n \"id_token_signing_alg_values_supported\": [\n \"RS256\"\n ],\n \"scopes_supported\": [\n \"openid\",\n \"profile\",\n \"email\",\n \"models:read\",\n \"usage:read\"\n ],\n \"token_endpoint_auth_methods_supported\": [\n \"client_secret_post\"\n ],\n \"agent_auth\": {\n \"skill\": \"https://docs.fishxcode.com/auth.md\",\n \"register_uri\": \"https://fishxcode.com/register?aff=9CTW\",\n \"identity_types_supported\": [\n \"anonymous\"\n ],\n \"anonymous\": {\n \"credential_types_supported\": [\n \"api_key\"\n ]\n },\n \"claim_uri\": \"https://fishxcode.com/console\",\n \"revocation_uri\": \"https://fishxcode.com/console\"\n }\n}"; export function GET() { return new Response(BODY, { diff --git a/src/app/.well-known/oauth-protected-resource/route.ts b/src/app/.well-known/oauth-protected-resource/route.ts index e582e7a..6f3e9a1 100644 --- a/src/app/.well-known/oauth-protected-resource/route.ts +++ b/src/app/.well-known/oauth-protected-resource/route.ts @@ -1,6 +1,6 @@ export const dynamic = 'force-static'; -const BODY = "{\n \"resource\": \"https://api.fishxcode.com/v1\",\n \"authorization_servers\": [\n \"https://docs.fishxcode.com\"\n ],\n \"scopes_supported\": [\n \"models:read\",\n \"usage:read\"\n ],\n \"bearer_methods_supported\": [\n \"header\"\n ],\n \"resource_name\": \"FishXCode API\"\n}"; +const BODY = "{\n \"resource\": \"https://docs.fishxcode.com\",\n \"authorization_servers\": [\n \"https://docs.fishxcode.com\"\n ],\n \"scopes_supported\": [\n \"models:read\",\n \"usage:read\"\n ],\n \"bearer_methods_supported\": [\n \"header\"\n ],\n \"resource_name\": \"FishXCode API\"\n}"; export function GET() { return new Response(BODY, { diff --git a/src/app/.well-known/openid-configuration/route.ts b/src/app/.well-known/openid-configuration/route.ts index a93e83e..d86dc16 100644 --- a/src/app/.well-known/openid-configuration/route.ts +++ b/src/app/.well-known/openid-configuration/route.ts @@ -1,6 +1,6 @@ export const dynamic = 'force-static'; -const BODY = "{\n \"issuer\": \"https://docs.fishxcode.com\",\n \"authorization_endpoint\": \"https://fishxcode.com/console\",\n \"token_endpoint\": \"https://fishxcode.com/console\",\n \"jwks_uri\": \"https://fishxcode.com/.well-known/jwks.json\",\n \"response_types_supported\": [\n \"code\"\n ],\n \"grant_types_supported\": [\n \"authorization_code\",\n \"client_credentials\"\n ],\n \"subject_types_supported\": [\n \"public\"\n ],\n \"id_token_signing_alg_values_supported\": [\n \"RS256\"\n ],\n \"scopes_supported\": [\n \"openid\",\n \"profile\",\n \"email\",\n \"models:read\",\n \"usage:read\"\n ],\n \"token_endpoint_auth_methods_supported\": [\n \"client_secret_post\"\n ],\n \"agent_auth\": {\n \"skill\": \"auth.md\",\n \"register_uri\": \"https://fishxcode.com/register?aff=9CTW\",\n \"identity_types_supported\": [\n \"anonymous\"\n ],\n \"anonymous\": {\n \"credential_types_supported\": [\n \"api_key\"\n ]\n },\n \"claim_uri\": \"https://fishxcode.com/console\",\n \"revocation_uri\": \"https://fishxcode.com/console\"\n }\n}"; +const BODY = "{\n \"issuer\": \"https://docs.fishxcode.com\",\n \"authorization_endpoint\": \"https://fishxcode.com/console\",\n \"token_endpoint\": \"https://fishxcode.com/console\",\n \"jwks_uri\": \"https://fishxcode.com/.well-known/jwks.json\",\n \"response_types_supported\": [\n \"code\"\n ],\n \"grant_types_supported\": [\n \"authorization_code\",\n \"client_credentials\"\n ],\n \"subject_types_supported\": [\n \"public\"\n ],\n \"id_token_signing_alg_values_supported\": [\n \"RS256\"\n ],\n \"scopes_supported\": [\n \"openid\",\n \"profile\",\n \"email\",\n \"models:read\",\n \"usage:read\"\n ],\n \"token_endpoint_auth_methods_supported\": [\n \"client_secret_post\"\n ],\n \"agent_auth\": {\n \"skill\": \"https://docs.fishxcode.com/auth.md\",\n \"register_uri\": \"https://fishxcode.com/register?aff=9CTW\",\n \"identity_types_supported\": [\n \"anonymous\"\n ],\n \"anonymous\": {\n \"credential_types_supported\": [\n \"api_key\"\n ]\n },\n \"claim_uri\": \"https://fishxcode.com/console\",\n \"revocation_uri\": \"https://fishxcode.com/console\"\n }\n}"; export function GET() { return new Response(BODY, { diff --git a/src/app/.well-known/poppy.json/route.ts b/src/app/.well-known/poppy.json/route.ts new file mode 100644 index 0000000..02d97d8 --- /dev/null +++ b/src/app/.well-known/poppy.json/route.ts @@ -0,0 +1,3 @@ +export { GET } from '../poppy/route'; + +export const dynamic = 'force-static'; diff --git a/src/app/.well-known/skills/index.json/route.ts b/src/app/.well-known/skills/index.json/route.ts new file mode 100644 index 0000000..bbc4077 --- /dev/null +++ b/src/app/.well-known/skills/index.json/route.ts @@ -0,0 +1,3 @@ +export { GET } from '../index/route'; + +export const dynamic = 'force-static'; diff --git a/vercel.json b/vercel.json index f8340bc..3d79d4a 100644 --- a/vercel.json +++ b/vercel.json @@ -26,12 +26,31 @@ { "source": "/api/status-data/perf-summary", "destination": "https://fishxcode.com/api/perf-metrics/summary?hours=24" }, { "source": "/api/status-data/perf-model", "destination": "https://fishxcode.com/api/perf-metrics?hours=24" }, { "source": "/api/status-data/pricing", "destination": "https://fishxcode.com/api/pricing" }, + { + "source": "/", + "has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }], + "destination": "/llms.mdx/index/content.md" + }, { "source": "/:path+.md", "destination": "/llms.mdx/:path+/content.md" } ], "headers": [ { "source": "/", - "headers": [{ "key": "Link", "value": "; rel=\"service-doc\", ; rel=\"service-desc\", ; rel=\"describedby\", ; rel=\"describedby\", ; rel=\"api-catalog\", ; rel=\"describedby\"" }] + "headers": [ + { "key": "Link", "value": "; rel=\"service-doc\", ; rel=\"service-desc\", ; rel=\"describedby\", ; rel=\"describedby\", ; rel=\"api-catalog\", ; rel=\"describedby\"" }, + { "key": "Vary", "value": "Accept" } + ] + }, + { + "source": "/.well-known/:path((?!llms\\.txt$).*)", + "headers": [ + { "key": "Content-Type", "value": "application/json; charset=utf-8" }, + { "key": "Access-Control-Allow-Origin", "value": "*" } + ] + }, + { + "source": "/.well-known/llms.txt", + "headers": [{ "key": "Content-Type", "value": "text/plain; charset=utf-8" }] }, { "source": "/api/pricing",