//#region src/tracing/toolAttributes.ts
const TOOL_ATTRIBUTE_FAMILIES = [
	{
		prefix: "tool",
		nameSuffixes: [".name", "_name"],
		argSuffixes: [
			".args",
			".arguments",
			".input",
			"_args",
			"_arguments",
			"_input"
		],
		extraNameKeys: ["tool"]
	},
	{
		prefix: "function",
		nameSuffixes: [".name", "_name"],
		argSuffixes: [
			".args",
			".arguments",
			".input",
			"_args",
			"_arguments"
		]
	},
	{
		prefix: "ai.toolCall",
		nameSuffixes: [".name"],
		argSuffixes: [
			".args",
			".arguments",
			".input"
		]
	},
	{
		prefix: "gen_ai.tool",
		nameSuffixes: [".name"],
		argSuffixes: [
			".args",
			".arguments",
			".input"
		],
		extraArgKeys: ["gen_ai.tool.call.args", "gen_ai.tool.call.arguments"]
	},
	{
		prefix: "agent.tool",
		nameSuffixes: ["_name"],
		argSuffixes: [
			".args",
			".arguments",
			".input"
		],
		extraNameKeys: ["agent.tool", "agent.toolName"]
	},
	{
		prefix: "codex.mcp",
		argSuffixes: [
			".args",
			".arguments",
			".input"
		],
		extraNameKeys: ["codex.mcp.tool"]
	}
];
const TOOL_NAME_ATTRIBUTE_KEYS = TOOL_ATTRIBUTE_FAMILIES.flatMap((family) => [...(family.nameSuffixes ?? []).map((suffix) => `${family.prefix}${suffix}`), ...family.extraNameKeys ?? []]);
const TOOL_ARGUMENT_ATTRIBUTE_KEYS = [
	...TOOL_ATTRIBUTE_FAMILIES.flatMap((family) => [...(family.argSuffixes ?? []).map((suffix) => `${family.prefix}${suffix}`), ...family.extraArgKeys ?? []]),
	"args",
	"arguments",
	"input"
];
function getFirstStringAttribute(attributes, keys) {
	if (!attributes) return;
	for (const key of keys) {
		const value = attributes[key];
		if (typeof value === "string" && value.trim()) return value.trim();
	}
}
function getToolNameFromAttributes(attributes) {
	return getFirstStringAttribute(attributes, TOOL_NAME_ATTRIBUTE_KEYS);
}
//#endregion
Object.defineProperty(exports, "TOOL_ARGUMENT_ATTRIBUTE_KEYS", {
	enumerable: true,
	get: function() {
		return TOOL_ARGUMENT_ATTRIBUTE_KEYS;
	}
});
Object.defineProperty(exports, "getFirstStringAttribute", {
	enumerable: true,
	get: function() {
		return getFirstStringAttribute;
	}
});
Object.defineProperty(exports, "getToolNameFromAttributes", {
	enumerable: true,
	get: function() {
		return getToolNameFromAttributes;
	}
});

//# sourceMappingURL=toolAttributes-1FS7OTcT.cjs.map