feat(telemetry): Add context breakdown to API response event (#19699)

This commit is contained in:
Sandy Tao
2026-02-24 15:26:28 -08:00
committed by GitHub
parent 70b650122f
commit 3ff5cfaaf6
8 changed files with 479 additions and 27 deletions
+10
View File
@@ -29,6 +29,16 @@ import type { MessageBus } from '../confirmation-bus/message-bus.js';
*/
export const MCP_QUALIFIED_NAME_SEPARATOR = '__';
/**
* Returns true if `name` matches the MCP qualified name format: "server__tool",
* i.e. exactly two non-empty parts separated by the MCP_QUALIFIED_NAME_SEPARATOR.
*/
export function isMcpToolName(name: string): boolean {
if (!name.includes(MCP_QUALIFIED_NAME_SEPARATOR)) return false;
const parts = name.split(MCP_QUALIFIED_NAME_SEPARATOR);
return parts.length === 2 && parts[0].length > 0 && parts[1].length > 0;
}
type ToolParams = Record<string, unknown>;
// Discriminated union for MCP Content Blocks to ensure type safety.