aps-agent/server/provider-sdk/index.ts

18 lines
705 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 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>;
}