18 lines
705 B
TypeScript
18 lines
705 B
TypeScript
|
|
/**
|
|||
|
|
* Provider 契约(架构设计第 6 节):业务系统接入平台的唯一形状。
|
|||
|
|
*
|
|||
|
|
* 只有三个方法:查能力、执行、查状态。Provider 是适配器,不是业务系统,也不承载模型上下文。
|
|||
|
|
* 能力描述怎么写见 docs/spec/capability-description.md;契约测试套件见任务 A2.4。
|
|||
|
|
*/
|
|||
|
|
import type { CapabilityId, ExecutionReceipt } from '@aps/contracts';
|
|||
|
|
|
|||
|
|
export interface ProviderManifest {
|
|||
|
|
id: string;
|
|||
|
|
capabilities: CapabilityId[];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export interface CapabilityProvider {
|
|||
|
|
manifest(): ProviderManifest;
|
|||
|
|
execute(capabilityId: CapabilityId, params: unknown): Promise<ExecutionReceipt>;
|
|||
|
|
status(executionId: string): Promise<ExecutionReceipt>;
|
|||
|
|
}
|