Files
deepseek-harness/website/zh-CN/api/index.md
T
lintianle efba9fab0a 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.
2026-07-16 18:13:34 +08:00

2.1 KiB
Raw Blame History

API 参考

本节是 DeepSeek Harness 的 API 参考。除本页外,cordis/harness/ 下的所有页面由脚本从源码生成pnpm run gen-website-api,CI 校验新鲜度),签名与说明永远与代码一致;生成页目前为英文,中文版将随统一翻译流程提供。

框架 API

Cordis 微内核提供的基础能力,所有插件开发都建立在这些 API 之上:

  • Context — 上下文对象,所有服务和方法的入口
  • Events — 事件系统 APIon / emit / bail / serial / waterfall
  • Fiber — 插件生命周期(状态机、effect、dispose
  • Registry — 插件注册(plugin / inject
  • Service — 服务基类

Harness API

每个 ctx.* 服务一页,按服务名索引:

事件总表:Harness events — 全部事件按作用域分组,含触发模式与载荷签名。

想学"怎么写一个 tool / 插件"?教程在开发指南;本节只做精确的接口参考。