(envelope: Option.Option<JsonRpcEnvelope>)
| 221 | }; |
| 222 | |
| 223 | const rpcAttrs = (envelope: Option.Option<JsonRpcEnvelope>): Record<string, unknown> => |
| 224 | Option.match(envelope, { |
| 225 | onNone: () => ({}), |
| 226 | onSome: (e) => ({ |
| 227 | ...(e.method && { "mcp.rpc.method": e.method }), |
| 228 | ...(e.id !== undefined && e.id !== null && { "mcp.rpc.id": String(e.id) }), |
| 229 | ...methodAttrs(e), |
| 230 | ...replyAttrs(e), |
| 231 | }), |
| 232 | }); |
| 233 | |
| 234 | export const annotateMcpRequest = ( |
| 235 | request: Request, |
no test coverage detected