Skip to content

Exporting a recording

An export writes one recording to one file: its audio, one block of its transcript, or its note tabs as Markdown. Nothing is read into the conversation; the plugin answers the file's path, size and SHA-256, never the content.

Plan, then commit

An export is two calls, and the second one writes exactly what the first one named.

const plan = await tools.plaud.plan_export({
  recordingId: "rec-1",
  kind: "transcript",
  block: "transaction",
})

// plan.output.path is the exact file the commit writes; plan.changes says the same in one line.
const written = await tools.plaud.export({ planId: plan.planId })
// written.output is { path, bytes, sha256 }.
  • plan_export is a read: it checks the input, resolves the destination and writes nothing. It reads no recording, so a plan costs no Plaud call.
  • export takes only the plan id. It re-checks the plan, re-reads the destination's gate, downloads or renders the bytes, and publishes the file atomically. A refused or failed export leaves no file behind.
  • A plan commits once and expires 15 minutes after it was made. PLAN_USED or PLAN_INVALID means plan again.

Show the person plan.output.path before the commit. An agent asks first when access is ask-changes; at read-only the export is refused.

What the plan names

Field Meaning
recordingId The recording's id, from recent or from Plaud's own list_files.
kind audio, transcript or note.
block A transcript's block: transaction (the default), transaction_polish, outline or mark_memo. It is refused for another kind.
destination An absolute file path inside an export root. Leave it out for the default.
overwrite true replaces a file that exists. Off by default, and an existing file is then INPUT_INVALID.

plan.output answers the same fields plus the resolved path, so the person confirms a path, not a guess.

Where the file goes

The default destination is below the first export root:

Kind Default file
audio <root>/audio/<recordingId>.mp3
transcript <root>/transcript/<recordingId>.<block>.md
note <root>/note/<recordingId>.md

exportRoots defaults to ["~/Plaud"], and the first root holds the default destination. A destination outside every root is PERMISSION_DENIED. A relative path, a folder, and an export root itself are INPUT_INVALID.

Outside the project, the caller's external_directory rules must allow the folder. The plugin evaluates them with OpenCode's own matcher, in the host's order, last match wins. An ask counts as a refusal: an unattended run never waits on a prompt. A saved "Always allow" and a policy plugin's permission.evaluate hook are not visible to a plugin, so a rule in the agent's permissions is what makes an unattended export work. Security states the hole in full.

Limits

  • maxAudioBytes caps one audio download, 2 GiB by default and up to 64 GiB.
  • A transcript or a note is refused with TOO_LARGE over 25 MiB of Markdown.
  • exportTimeoutMs caps the whole export, 30 minutes by default, counted from the commit.
  • A failed audio link is followed by hand: every hop must be https (plain http only on localhost) with no user name or password, and a local address may not be reached through a link that was not local.

When it is refused

Code What happened
PERMISSION_DENIED The destination is outside the export roots, or the external_directory rules do not allow it.
INPUT_INVALID The destination is relative, is an export root, or exists and the plan did not say overwrite.
TOO_LARGE The audio is over maxAudioBytes, or the text is over 25 MiB.
PLAN_INVALID, PLAN_USED The plan is missing, belongs to another method, or was already committed.
UNAVAILABLE Plaud did not answer, the audio link failed, or the disk write failed. Read status first.

An export from a session on a workspace is UNAVAILABLE: the workspace's files are not on this machine.