Files
deepseek-harness/packages/api/gateway/src/remote-error-codes.ts
T
imccyu 804b1ffbfc refactor(api): converge the Remote failure vocabulary and client surface
Single RemoteError with a merge-extensible, domain-prefixed code map;
owners throw at the failure point; streams surface marked failures;
clients consume ctx.remote directly with isRemoteFailure as the only
discrimination point and construct no failure instances.
2026-08-28 22:37:36 +08:00

36 lines
1.6 KiB
TypeScript

/**
* Gateway infrastructure failure codes merged into the shared Remote failure
* vocabulary. Face-neutral: the Host face and the Client face each import this
* module so both programs see the same map entries.
*/
/** Wire details every Gateway infrastructure failure carries. */
export interface TypertGatewayFaultDetails {
/** Canonical `<namespace>/<method>` endpoint. */
readonly endpoint: string
/** Affected wire field when the failure is field-specific. */
readonly field?: string
}
declare module '@deepseek-ai/dsh-typert-protocol' {
interface RemoteErrorDetailsMap {
'gateway/ambiguous-endpoint': TypertGatewayFaultDetails
'gateway/arguments-invalid': TypertGatewayFaultDetails
'gateway/binding-invalid': TypertGatewayFaultDetails
'gateway/context-failed': TypertGatewayFaultDetails
'gateway/context-not-found': TypertGatewayFaultDetails
'gateway/context-unavailable': TypertGatewayFaultDetails
'gateway/definition-unavailable': TypertGatewayFaultDetails
'gateway/input-invalid': TypertGatewayFaultDetails
'gateway/invocation-unavailable': TypertGatewayFaultDetails
'gateway/lookup-failed': TypertGatewayFaultDetails
'gateway/lookup-not-found': TypertGatewayFaultDetails
'gateway/lookup-unavailable': TypertGatewayFaultDetails
'gateway/method-unavailable': TypertGatewayFaultDetails
'gateway/provider-mismatch': TypertGatewayFaultDetails
'gateway/result-invalid': TypertGatewayFaultDetails
'gateway/service-unavailable': TypertGatewayFaultDetails
'gateway/signature-invalid': TypertGatewayFaultDetails
}
}