* 统一错误响应格式
(error: string, code: string)
| 59 | * 统一错误响应格式 |
| 60 | */ |
| 61 | function errorResponse(error: string, code: string) { |
| 62 | return { error, code }; |
| 63 | } |
| 64 | |
| 65 | function getInvocationId(request: { headers: Record<string, unknown> }): string | null { |
| 66 | const header = request.headers['x-agent-tower-invocation-id']; |