MCPcopy Create free account
hub / github.com/Noumena-Network/code / exportHandler

Function exportHandler

src/cli/handlers/ant.ts:691–708  ·  view source on GitHub ↗
(
  source: string,
  outputFile: string,
)

Source from the content-addressed store, hash-verified

689}
690
691export async function exportHandler(
692 source: string,
693 outputFile: string,
694): Promise<void> {
695 try {
696 const log = await resolveLogSource(source)
697 const outputPath = expandPath(outputFile)
698 const rendered = await renderLog(log)
699
700 await mkdir(dirname(outputPath), { recursive: true })
701 await writeFile(outputPath, rendered, 'utf8')
702 writeToStdout(`Conversation exported to ${outputPath}\n`)
703 await gracefulShutdown(0)
704 } catch (error) {
705 writeToStderr(`Failed to export conversation: ${errorMessage(error)}\n`)
706 await gracefulShutdown(1)
707 }
708}
709
710export async function taskCreateHandler(
711 subject: string,

Callers 1

runFunction · 0.85

Calls 8

resolveLogSourceFunction · 0.85
expandPathFunction · 0.85
renderLogFunction · 0.85
mkdirFunction · 0.85
writeToStdoutFunction · 0.85
gracefulShutdownFunction · 0.85
writeToStderrFunction · 0.85
errorMessageFunction · 0.50

Tested by

no test coverage detected