The madness and chaos of the first weeks of the Trump presidency are now the stuff of White House and journalistic legend, complete with flaky and inexperienced advisers, quirky Cabinet appointments, combative phone calls to world leaders and the rise of unfiltered social media messaging to millions direct from the East Wing.

As the then-FBI director, James Comey had a front-row seat to what he now regards as something of a public administration horror show.

Before his firing from the job, Mr Comey last year admitted to the US Senate that he resorted to a practice which, for him, was unusual — documenting the detail of every meeting he held with Mr Trump as quickly as he could after he emerged from them.

On one occasion, he hurriedly typed out his recollections in the seat of his car as it pulled away from the Trump Tower and snaked through the streets of New York City on a Saturday in early January.

Those official memos, declassified and yielded to Congress, have now been released.

They give Mr Comey's version of bizarre conversations with Mr Trump on leakers, liars, prostitutes and Vladimir Putin.

Sorry, this video has expired James Comey tells 7.30 he feels "sick to my stomach" at the thought he may have had an impact on the 2016 US election.

Leaks with leaders

Since their first hostile phone call on January 28, 2017, Mr Trump and Malcolm Turnbull have been unstinting in their mutual efforts to strip away any residual damage it caused — they've accumulated hours of contact in face-to-face meetings in Germany, Washington, New York, Manila and Da Nang.

In the months that passed after the phone call, Mr Trump grew dismissive of its significance.

Sitting alongside Mr Turnbull on the decommissioned warship USS Intrepid last May, he told reporters: "We had a great telephone call. You guys exaggerated that call. That was a big exaggeration. We're not babies."

Mr Comey's memos tell a different story.

In one, written minutes after a visit to the White House on February 14, Mr Comey paints a picture of a president in high agitation over the leaks against him.

"He then reviewed in some detail the leaks of his calls with the leaders of Mexico and Australia, including how the calls had gone, how he assumed that calls he made on 'this beautiful phone [touching the grey phone on the desk]' were confidential, how it couldn't have come from the Mexicans or Australians, how the transcripts actually included things he doesn't remember saying ['and they say I have one of the world's greatest memories']," the memo says.

According to the Comey account, Mr Trump was desperate to know who had divulged the details of his conversations not once — with Mr Turnbull — but twice, by leaking the talking points of his testy call with Mexican President Enrique Pena Nieto the same day.

"It makes us look terrible to have these things leaking," Mr Comey recalls an anguished Mr Trump telling him. "I tried to interject several times to agree with him about the leaks being terrible, but was unsuccessful. When he finished, I said I agreed very much that it was terrible that his calls with foreign leaders leaked."

Donald Trump hosted Malcolm Turnbull at the White House. ( Facebook: Malcolm Turnbull )

At the time, Mr Trump and his then-advisers Steve Bannon, Mike Flynn, Reince Priebus, Stephen Miller and were rattled by a feared "deep state" element within the wider Washington bureaucracy — an unspecified and unknown cabal of officials who may not have the best interests of the elected government at heart.

Mr Comey's memos certainly confirm that the White House harboured no suspicions that the Australian or Mexican governments had leaked, and that if the leakers in the US could not be identified, then Mr Trump would like to have seen journalists cough up their names.

"He [Mr Trump] replied by saying it may involve putting reporters in jail. They spend a couple of days in jail, make a new friend, and they are ready to talk," Mr Comey recalls.

To this day, Mr Trump disputes almost everything Mr Comey has written or said about those turbulent three months from January to May when Mr Comey ran the bureau.

After the release of the memos, Mr Trump tweeted:

"…Shadey (sic) James Comey can Leak and Lie and make lots of money from a third rate book (that should never have been written). Is that really the way life in America is supposed to work? I don't think so!"

Mr Comey's book, A Higher Loyalty, triggered a backlash from Mr Trump, who called him a "slimeball". ( Reuters: Mike Segar )

The 'golden showers thing'

If Mr Trump was vexed by leaks of his Oval Office conversations on that "beautiful phone" on his Resolute Desk, he was completely unnerved by what Mr Comey may have known about his alleged dealings with Russia, its leaders and its prostitutes.

He had questioned Mr Comey about his knowledge of the contents of an unconfirmed dossier which, among other things, claims Mr Trump had watched as two Russian prostitutes urinated on each other on a bed in the Presidential Suite of Moscow's Ritz-Carlton Hotel in 2013.

"There were no prostitutes, there were never prostitutes," a Comey memo from early January quotes Mr Trump saying. "He then said something about him being the kind of guy who didn't need to "go there" and laughed (which I understood to be communicating that he didn't need to pay for sex). He said '2013' to himself, as if trying to remember that period of time, but didn't add anything"

It was a subject Mr Trump returned to a couple of weeks later over an intimate dinner alone with Mr Comey in the Green Room of the White House — again, captured in granular detail by another of Mr Comey's memos.

The Comey record suggestions Mr Trump did most of the talking as the FBI director struggled with the structure of the conversation: "It really was conversation-as-jigsaw-puzzle in a way, with pieces picked up, then discarded, then returned to."

At some point in the 1 hour and 20 minute encounter, the matter of paying Russian women for lewd acts was picked up and returned to.

"He turned to what he called the 'golden showers thing' and recounted much of what he had said previously on that topic," the memo said. "He repeated that it was a complete fabrication and 'fake news'… he said it bothered him if his wife thought there was even a 1 per cent chance it was true in any respect … he said he thought maybe he should ask me to investigate the whole thing to prove it was a lie."

History, and Mr Comey's much-publicised book A Higher Loyalty, will record that no FBI investigation was ever held, because the White House accepted Mr Comey's eminently sensible advice that it might not be a good look for the American public to find out their President's private bedroom conduct — real or alleged — was the subject of a federal inquiry.

Comey is gone, but the fight goes on

The spectacle of Mr Comey hawking his book and reflecting on Mr Trump's moral authority to lead has fed not so much a national conversation as a partisan screeching match across the US this last week — and it will not abate.

Make no mistake — Mr Trump is giving as good as he gets.

Loading

Far from being cowed or embarrassed, Mr Trump's advisers have let it be known that they believe Mr Trump has "weathered the storm" stirred by the Comey publications — which has again brought Mr Trump's brand of plucky pugilism to the fore.

Loading

The "witch hunt" won't be over until the mother of all investigations surrounding the Trump family and its 2016 campaign contacts with Russia is over.

That investigation, led by veteran FBI director Robert Mueller, is reaching a critical final phase and confronting a pivotal question — whether Mr Trump himself should be interviewed under oath.

Mr Trump protests his innocence over Russian collusion at every turn and nothing in the Comey memos or his book comes close to the standard of evidence required to make a charge against Mr Trump.

Even so, most of Mr Trump's first 15 months in office have been shaded by what he called the "cloud" of allegations hanging above him and he vents his frustration almost daily.

Mustering the deep financial resources at his disposal, Mr Trump has now bolstered his small army of personal lawyers to try to see off the Mueller probe.

The week ended with the addition of his old friend and former New York mayor Rudy Guiliani, and Florida-based attorneys Jane and Martin Raskin.

Mr Guiliani has a goal to try to guide the Mueller investigation towards an end within weeks which, by general consensus, is considered an ambitious timeline.

Mr Trump appears to have seen off the worst of the dangers presented by Mr Comey, but the "cloud" he has governed beneath will hang heavy over the White House until all his legal woes are dealt with.