website: generate the API reference from source (cordis + all 15 harness services)
scripts/gen-website-api.ts renders website/zh-CN/api/{cordis,harness}/* and the
api-sidebar.json fragment the VitePress config imports, so pages and navigation
can never drift from the code: signatures, @param/@returns prose, dispatch
modes, and GitHub source links are extracted, never transcribed, and the
generator hard-errors on any rendered member missing docs. verify-website-api
(doc-sync + run-gates) is the freshness gate.
Replaces the hand-written zh api pages (7 pages covering 7 of 15 services,
with phantom APIs: Context.current/Context.events, agent/post-step, tool/call,
compact/*, llm/pre-request none of which exist) with generated English
references: 5 cordis pages, 15 per-service pages, and a 35-event catalog
grouped by scope. The hand-written hub api/index.md stays and now indexes the
full surface; zh for these pages arrives with the unified translation flow.
This commit is contained in:
90
website/.vitepress/config/api-sidebar.json
Normal file
90
website/.vitepress/config/api-sidebar.json
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"cordis": [
|
||||
{
|
||||
"text": "Context",
|
||||
"link": "/zh-CN/api/cordis/context"
|
||||
},
|
||||
{
|
||||
"text": "Events",
|
||||
"link": "/zh-CN/api/cordis/events"
|
||||
},
|
||||
{
|
||||
"text": "Fiber",
|
||||
"link": "/zh-CN/api/cordis/fiber"
|
||||
},
|
||||
{
|
||||
"text": "Registry",
|
||||
"link": "/zh-CN/api/cordis/registry"
|
||||
},
|
||||
{
|
||||
"text": "Service",
|
||||
"link": "/zh-CN/api/cordis/service"
|
||||
}
|
||||
],
|
||||
"harness": [
|
||||
{
|
||||
"text": "ctx.agentLoop",
|
||||
"link": "/zh-CN/api/harness/agent-loop"
|
||||
},
|
||||
{
|
||||
"text": "ctx.agents",
|
||||
"link": "/zh-CN/api/harness/agents"
|
||||
},
|
||||
{
|
||||
"text": "ctx.bash",
|
||||
"link": "/zh-CN/api/harness/bash"
|
||||
},
|
||||
{
|
||||
"text": "ctx.codeRuntime",
|
||||
"link": "/zh-CN/api/harness/code-runtime"
|
||||
},
|
||||
{
|
||||
"text": "ctx.compact",
|
||||
"link": "/zh-CN/api/harness/compact"
|
||||
},
|
||||
{
|
||||
"text": "ctx.fs",
|
||||
"link": "/zh-CN/api/harness/fs"
|
||||
},
|
||||
{
|
||||
"text": "ctx.llm",
|
||||
"link": "/zh-CN/api/harness/llm"
|
||||
},
|
||||
{
|
||||
"text": "ctx.sessionPersistence",
|
||||
"link": "/zh-CN/api/harness/session-persistence"
|
||||
},
|
||||
{
|
||||
"text": "ctx.sessions",
|
||||
"link": "/zh-CN/api/harness/sessions"
|
||||
},
|
||||
{
|
||||
"text": "ctx.subagents",
|
||||
"link": "/zh-CN/api/harness/subagents"
|
||||
},
|
||||
{
|
||||
"text": "ctx.systemPrompt",
|
||||
"link": "/zh-CN/api/harness/system-prompt"
|
||||
},
|
||||
{
|
||||
"text": "ctx.tools",
|
||||
"link": "/zh-CN/api/harness/tools"
|
||||
},
|
||||
{
|
||||
"text": "ctx.userInteraction",
|
||||
"link": "/zh-CN/api/harness/user-interaction"
|
||||
},
|
||||
{
|
||||
"text": "ctx.web",
|
||||
"link": "/zh-CN/api/harness/web"
|
||||
},
|
||||
{
|
||||
"text": "ctx.workflows",
|
||||
"link": "/zh-CN/api/harness/workflows"
|
||||
},
|
||||
{
|
||||
"text": "Events",
|
||||
"link": "/zh-CN/api/harness/events"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user