Files
deepseek-harness/website/zh-CN/api/index.md
T
lintianle 2cde2a9032 Merge origin/master into feat/website-docs
Conflict resolution notes:
- package.json/run-gates: both sides' new doc-sync gates kept (master's
  scoped-events/readme gates + this branch's website-api/website-yaml);
  js-yaml devDeps deduped (master added them independently).
- pnpm-workspace/knip: website AND python/sdk-runtime entries kept.
- doc-typecheck/verify-type-equiv: master's condensed headers kept, website
  glob retained in both scan scopes.
- vendor/cordis/src/fiber.ts: master's lifecycle-hardening code taken; this
  branch's richer FiberState JSDoc reapplied on top. vendor/README.md logs
  both local modifications (hardening = 6, JSDoc enrichment = 7).
- pnpm-lock: regenerated from master's side (pnpm install).

Post-merge sync the gates forced (the system working as designed):
- verify-website-yaml caught 4 stale plugin names from master's package
  reorg (dsh-stdio-agent -> dsh-stdio-demo, dsh-acp-agent -> dsh-acp-demo);
  8 references fixed across guide/ and develop/.
- gen-website-api picked up master's 6 new services automatically
  (ctx.approval/permission/sandbox/sessionQuery/skills/tasks -> 6 new pages
  + sidebar); api/index.md hub updated to list them.
- AGENTS.md budget ceiling 1370 -> 1400: the website rows (layout line + two
  command lines) and master's own growth collided with the old ceiling; all
  three website rows are load-bearing (new top-level dir, new CI command).
2026-07-16 21:36:43 +08:00

2.4 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 / 插件"?教程在开发指南;本节只做精确的接口参考。