After days of cross-border fighting, Pakistan and Afghan Taliban authorities agreed a temporary ceasefire.