aps-agent/providers/aps/index.ts

29 lines
1.1 KiB
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.

/**
* APS Provider(架构设计第 6 节):把 APS 的能力翻译成平台契约。
*
* 只做适配:参数校验、调用 APS、结果归一化。不判断权限、不碰模型上下文。
* APS 本身是独立系统(Python + aps/ 目录,ADR-0010),能力清单在 A5 阶段补齐。
*/
import { ProviderError, type CapabilityCall, type ExecutionContext, type HealthStatus, type Provider, type ProviderManifest } from '@aps/provider-sdk';
export const APS_PROVIDER_ID = 'aps';
export function createApsProvider(): Provider {
return {
async describe(): Promise<ProviderManifest> {
return {
id: APS_PROVIDER_ID,
displayName: 'APS 排产系统',
version: '0.0.0',
platformVersion: 1,
capabilities: [],
};
},
async invoke(_context: ExecutionContext, call: CapabilityCall) {
throw new ProviderError('unavailable', `APS Provider 尚未实现能力 ${call.capabilityId}(A5 阶段接入)`);
},
async health(): Promise<HealthStatus> {
return { status: 'down', detail: 'A5 阶段接入 APS 后启用', checkedAt: Date.now() };
},
};
}