Files
deepseek-harness/website/zh-CN/api/cordis/service.md
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.5 KiB

Service

Base class for context services: subclass it and load the subclass as a plugin to register ctx.<name>.

Base class for services that expose a named API on ctx. Subclasses call super(ctx, name) from their constructor. The service is registered immediately and is automatically removed with the owning fiber.

Source

service.name

public name!: string

The service name this instance is registered under.

Source

Static members

Service.init

static readonly init: unique symbol

Symbol key of an instance method run after construction (class plugins).

Source

Service.check

static readonly check: unique symbol

Symbol key of the availability predicate passed to ctx.provide().

Source

Service.config

static readonly config: unique symbol

Symbol key of the phantom intercept-config type parameter.

Source

Service.invoke

static readonly invoke: unique symbol

Symbol key of the call body making a service callable (e.g. ctx.logger()).

Source

Service.extend

static readonly extend: unique symbol

Symbol key of the helper deriving an extended service instance.

Source

Service.tracker

static readonly tracker: unique symbol

Symbol key of the tracker metadata used for context tracing.

Source

Service.resolveConfig

static readonly resolveConfig: unique symbol

Symbol key of the intercept-config resolution helper below.

Source