//#region src/domains/run/a2a/types.ts
/**
* Type guard to check if a Task contains transfer data
*/
function isTransferTask(result) {
	if (!("artifacts" in result) || !result.artifacts) return false;
	return result.artifacts.some((artifact) => artifact.parts.some((part) => {
		if (part.kind !== "data" || !part.data) return false;
		return typeof part.data === "object" && "type" in part.data && part.data.type === "transfer";
	}));
}
/**
* Helper to safely extract transfer data from a TransferTask
* Returns null if no transfer data found
*/
function extractTransferData(task) {
	for (const artifact of task.artifacts) for (const part of artifact.parts) if (part.kind === "data" && part.data?.type === "transfer") return part.data;
	return null;
}

//#endregion
export { extractTransferData, isTransferTask };