Files
deepseek-harness/website/zh-CN/api/cordis/service.md
T

93 lines
2.5 KiB
Markdown
Raw Normal View History

<!-- Generated by scripts/gen-website-api.ts — do not edit by hand. Run `pnpm run gen-website-api` to regenerate. -->
2026-07-09 16:07:58 +08:00
# Service
2026-07-09 16:07:58 +08:00
Base class for context services: subclass it and load the subclass as a plugin to register `ctx.<name>`.
2026-07-09 16:07:58 +08:00
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.
2026-07-09 16:07:58 +08:00
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L11)
2026-07-09 16:07:58 +08:00
### service.name
2026-07-09 16:07:58 +08:00
```ts website-api
public name!: string
2026-07-09 16:07:58 +08:00
```
The service name this instance is registered under.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L30)
2026-07-09 16:07:58 +08:00
## Static members
2026-07-09 16:07:58 +08:00
### Service.init
2026-07-09 16:07:58 +08:00
```ts website-api
static readonly init: unique symbol
```
Symbol key of an instance method run after construction (class plugins).
2026-07-09 16:07:58 +08:00
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L13)
2026-07-09 16:07:58 +08:00
### Service.check
2026-07-09 16:07:58 +08:00
```ts website-api
static readonly check: unique symbol
```
2026-07-09 16:07:58 +08:00
Symbol key of the availability predicate passed to `ctx.provide()`.
2026-07-09 16:07:58 +08:00
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L15)
2026-07-09 16:07:58 +08:00
### Service.config
2026-07-09 16:07:58 +08:00
```ts website-api
static readonly config: unique symbol
```
2026-07-09 16:07:58 +08:00
Symbol key of the phantom intercept-config type parameter.
2026-07-09 16:07:58 +08:00
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L17)
2026-07-09 16:07:58 +08:00
### Service.invoke
2026-07-09 16:07:58 +08:00
```ts website-api
static readonly invoke: unique symbol
```
2026-07-09 16:07:58 +08:00
Symbol key of the call body making a service callable (e.g. `ctx.logger()`).
2026-07-09 16:07:58 +08:00
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L19)
2026-07-09 16:07:58 +08:00
### Service.extend
2026-07-09 16:07:58 +08:00
```ts website-api
static readonly extend: unique symbol
```
2026-07-09 16:07:58 +08:00
Symbol key of the helper deriving an extended service instance.
2026-07-09 16:07:58 +08:00
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L21)
2026-07-09 16:07:58 +08:00
### Service.tracker
2026-07-09 16:07:58 +08:00
```ts website-api
static readonly tracker: unique symbol
```
2026-07-09 16:07:58 +08:00
Symbol key of the tracker metadata used for context tracing.
2026-07-09 16:07:58 +08:00
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L23)
2026-07-09 16:07:58 +08:00
### Service.resolveConfig
2026-07-09 16:07:58 +08:00
```ts website-api
static readonly resolveConfig: unique symbol
2026-07-09 16:07:58 +08:00
```
Symbol key of the intercept-config resolution helper below.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L25)