docs: capitalize Service Provider across repository

This commit is contained in:
Turtle
2026-08-13 11:55:38 +08:00
parent dc3fc72d57
commit 1540e76598
187 changed files with 306 additions and 301 deletions
+7 -7
View File
@@ -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