2026-09-23 19:29:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* APS Provider(架构设计第 6 节):把 APS 的能力翻译成平台契约。
|
|
|
|
|
|
*
|
|
|
|
|
|
* 只做适配:参数校验、调用 APS、结果归一化。不判断权限、不碰模型上下文。
|
2026-09-24 15:48:45 +08:00
|
|
|
|
* APS 本身是独立系统(Python + aps/ 目录,ADR-0010),能力清单在 A5 阶段补齐。
|
2026-09-23 19:29:57 +08:00
|
|
|
|
*/
|
2026-09-24 15:48:45 +08:00
|
|
|
|
import { ProviderError, type CapabilityCall, type ExecutionContext, type HealthStatus, type Provider, type ProviderManifest } from '@aps/provider-sdk';
|
2026-09-23 19:29:57 +08:00
|
|
|
|
|
|
|
|
|
|
export const APS_PROVIDER_ID = 'aps';
|
|
|
|
|
|
|
2026-09-24 15:48:45 +08:00
|
|
|
|
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() };
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|