| 29 | } |
| 30 | |
| 31 | export function getMCPUserAgent(): string { |
| 32 | const parts: string[] = [] |
| 33 | if (process.env.CLAUDE_CODE_ENTRYPOINT) { |
| 34 | parts.push(process.env.CLAUDE_CODE_ENTRYPOINT) |
| 35 | } |
| 36 | if (process.env.NCODE_AGENT_SDK_VERSION) { |
| 37 | parts.push(`agent-sdk/${process.env.NCODE_AGENT_SDK_VERSION}`) |
| 38 | } |
| 39 | if (process.env.NCODE_AGENT_SDK_CLIENT_APP) { |
| 40 | parts.push(`client-app/${process.env.NCODE_AGENT_SDK_CLIENT_APP}`) |
| 41 | } |
| 42 | const suffix = parts.length > 0 ? ` (${parts.join(', ')})` : '' |
| 43 | return `ncode/${MACRO.VERSION}${suffix}` |
| 44 | } |
| 45 | |
| 46 | // User-Agent for WebFetch requests to arbitrary sites. |
| 47 | export function getWebFetchUserAgent(): string { |