mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
docs: capitalize Service Provider across repository
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
||||
# after editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write docs/user/develop/basic/tool.md
|
||||
tool.md: a149f6876c573c9ece4b066ef6c211f69b0b03a8
|
||||
tool.zh.md: bcce5001497908cefa643749caee8da0e9859cf7
|
||||
tool.md: eb262d131a7f2b540827e86e56f8c0a28cb5f904
|
||||
tool.zh.md: d33d9946a73881df2cd44ebf3695819d02d013ab
|
||||
|
||||
@@ -49,4 +49,4 @@ Open `http://127.0.0.1:3080` and ask: `Use the greet tool to greet Ada.` The mod
|
||||
|
||||
- [Plugin configuration](./config.md) — make the greeting configurable.
|
||||
- [Tool authoring reference](../../../cookbook/adding-a-tool.md) — look up nested schemas, canonical values, background work, policy hooks, Code Mode, and UI cards.
|
||||
- [Capability layering](../practice/) — split a replaceable capability into Service Definition, Service provider, and Consumer packages.
|
||||
- [Capability layering](../practice/) — split a replaceable capability into Service Definition, Service Provider, and Consumer packages.
|
||||
|
||||
@@ -49,4 +49,4 @@ pnpm dsh web --patch ./scratch-plugin/cordis.yml
|
||||
|
||||
- [插件配置](./config.md) — 让问候语可配置。
|
||||
- [工具编写参考](../../../cookbook/adding-a-tool.md) — 查阅嵌套 schema、规范值、后台工作、策略钩子、Code Mode 和 UI 卡片。
|
||||
- [能力分层](../practice/) — 将可替换能力拆分为 Service Definition、Service provider 和 Consumer 三类包。
|
||||
- [能力分层](../practice/) — 将可替换能力拆分为 Service Definition、Service Provider 和 Consumer 三类包。
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
||||
# after editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write docs/user/develop/practice/index.md
|
||||
index.md: 3619a39f4a39b42cf4269d3778f233ecc1731933
|
||||
index.zh.md: 8bd378af5eaf2741c34d76a152fa8a62a947bf41
|
||||
index.md: 56ca7249b8b156ceb78327b547413dbf65726dcc
|
||||
index.zh.md: aec5980ea45cfd5f8f7408877743920e68e15cbd
|
||||
|
||||
@@ -6,14 +6,14 @@ This page has two parts: a concept reference for the three-role capability patte
|
||||
|
||||
## Concept reference
|
||||
|
||||
When a capability is general enough to need replaceable providers, such as Bash execution, Harness separates three roles: a **Service Definition**, a **Service provider**, and a **Consumer**. Put the roles in separate packages when they need to evolve or be replaced independently; a package may otherwise own more than one role. The complete capability is its seam. No individual role is a seam.
|
||||
When a capability is general enough to need replaceable providers, such as Bash execution, Harness separates three roles: a **Service Definition**, a **Service Provider**, and a **Consumer**. Put the roles in separate packages when they need to evolve or be replaced independently; a package may otherwise own more than one role. The complete capability is its seam. No individual role is a seam.
|
||||
|
||||
## Bash example
|
||||
|
||||
The Bash execution capability consists of:
|
||||
|
||||
- **Service Definition** (`dsh-shell`) — defines the Cordis service and Bash request and result types
|
||||
- **Service provider** (`dsh-bash-local`) — executes commands on the local machine
|
||||
- **Service Provider** (`dsh-bash-local`) — executes commands on the local machine
|
||||
- **Consumer** (`dsh-tool-bash`) — exposes the capability as a model-callable tool
|
||||
|
||||
```
|
||||
@@ -44,14 +44,14 @@ The Service Definition and tool remain unchanged while the provider changes.
|
||||
### Evolve independently
|
||||
|
||||
- The Service Definition changes rarely after callers depend on its contract.
|
||||
- Service providers can improve performance and security independently.
|
||||
- Service Providers can improve performance and security independently.
|
||||
- Consumers can change how they present the capability to the model.
|
||||
|
||||
### Decouple dependencies
|
||||
|
||||
- The Service provider depends on the Service Definition.
|
||||
- The Service Provider depends on the Service Definition.
|
||||
- The Consumer depends on the Service Definition.
|
||||
- The Service provider and Consumer **do not depend on each other**.
|
||||
- The Service Provider and Consumer **do not depend on each other**.
|
||||
|
||||
The [capability-seam reference](../../../capability-seams.md) owns the current built-in families and package links.
|
||||
|
||||
@@ -87,7 +87,7 @@ export interface MyCapResult {
|
||||
}
|
||||
```
|
||||
|
||||
### Step 2: write a Service provider
|
||||
### Step 2: write a Service Provider
|
||||
|
||||
```ts ignore-check
|
||||
// packages/my-cap/my-cap-local/src/index.ts
|
||||
@@ -147,7 +147,7 @@ export function apply(ctx: Context) {
|
||||
## Design points
|
||||
|
||||
- **Do not split preemptively** — use separate packages only when the roles need to evolve independently. A simple tool plugin does not.
|
||||
- **The Service Definition owns Request/Result types** — Service providers and Consumers depend only on the Service Definition package.
|
||||
- **The Service Definition owns Request/Result types** — Service Providers and Consumers depend only on the Service Definition package.
|
||||
- **Explicit > implicit** — resolve defaults in an explicit `resolve(request): Spec` step rather than hiding `?? default` expressions inside `run()`.
|
||||
|
||||
## Next steps
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
## 概念参考
|
||||
|
||||
当一项能力足够通用,需要支持可替换的提供方时(例如 Bash 执行),harness 会区分三种角色:**Service Definition**、**Service provider** 和 **Consumer**。角色需要独立演进或替换时,将它们放入不同包;否则一个包可以承担多个角色。完整能力构成其 seam。任何单一角色都不是 seam。
|
||||
当一项能力足够通用,需要支持可替换的提供方时(例如 Bash 执行),harness 会区分三种角色:**Service Definition**、**Service Provider** 和 **Consumer**。角色需要独立演进或替换时,将它们放入不同包;否则一个包可以承担多个角色。完整能力构成其 seam。任何单一角色都不是 seam。
|
||||
|
||||
## 以 Bash 为例
|
||||
|
||||
以 Bash 执行能力为例:
|
||||
|
||||
- **Service Definition** (`dsh-shell`):定义 Cordis 服务以及 Bash 请求和结果类型
|
||||
- **Service provider** (`dsh-bash-local`):在本地计算机上执行命令
|
||||
- **Service Provider** (`dsh-bash-local`):在本地计算机上执行命令
|
||||
- **Consumer** (`dsh-tool-bash`):将该能力公开为模型可调用的工具
|
||||
|
||||
```
|
||||
@@ -44,14 +44,14 @@
|
||||
### 独立演进
|
||||
|
||||
- 调用方开始依赖 Service Definition 的约定后,Service Definition 很少改动。
|
||||
- Service provider 可以独立优化性能和安全性。
|
||||
- Service Provider 可以独立优化性能和安全性。
|
||||
- Consumer 可以调整能力向模型呈现的方式。
|
||||
|
||||
### 依赖解耦
|
||||
|
||||
- Service provider 依赖 Service Definition。
|
||||
- Service Provider 依赖 Service Definition。
|
||||
- Consumer 依赖 Service Definition。
|
||||
- Service provider 和 Consumer **互不依赖**。
|
||||
- Service Provider 和 Consumer **互不依赖**。
|
||||
|
||||
当前内置系列及其包链接由[能力 seam 参考](../../../capability-seams.md)负责。
|
||||
|
||||
@@ -87,7 +87,7 @@ export interface MyCapResult {
|
||||
}
|
||||
```
|
||||
|
||||
### 第二步:编写 Service provider
|
||||
### 第二步:编写 Service Provider
|
||||
|
||||
```ts ignore-check
|
||||
// packages/my-cap/my-cap-local/src/index.ts
|
||||
@@ -147,7 +147,7 @@ export function apply(ctx: Context) {
|
||||
## 设计要点
|
||||
|
||||
- **不要预防性拆分**:只有角色需要独立演进时,才使用不同包。简单的工具插件无需拆分。
|
||||
- **Service Definition 拥有 Request/Result 类型**:Service provider 和 Consumer 只依赖 Service Definition 包。
|
||||
- **Service Definition 拥有 Request/Result 类型**:Service Provider 和 Consumer 只依赖 Service Definition 包。
|
||||
- **显式优于隐式**:实现应通过显式的 `resolve(request): Spec` 步骤处理默认值,而不是在 `run()` 中隐藏 `?? default`。
|
||||
|
||||
## 下一步
|
||||
|
||||
Reference in New Issue
Block a user