Context Object

The context object passed to every plugin's render() function.

The render() function receives a context object with information about the current rendering environment.

Widget context

render(context) {
  context.mode                // 'widget' | 'full'
  context.transcriptSegments  // array (if @events transcript:segment declared)
}
FieldTypeDescription
mode'widget' | 'full'Whether rendering in the sidebar or full content panel
transcriptSegmentsArrayLive transcript data. Only present if @events transcript:segment is declared.

Renderer context

Renderers receive two arguments — the file content as a string and a context object:

render(content, context) {
  content             // string — the raw file content
  context.filePath    // string — path of the file being rendered
  context.fileContent // string — same as content (for convenience)
}
FieldTypeDescription
content (first argument)stringThe raw file content
context.filePathstringPath of the file being rendered
context.fileContentstringSame as the first content argument

Agent context

Agent plugins receive a minimal context:

render(context) {
  // context is currently empty for agent plugins
  // Future: will include active file path, workspace state
}

Transcript segments

Each segment in context.transcriptSegments has:

FieldTypeDescription
textstringThe transcribed text
speakerstringSpeaker identity (email)
displayNamestringSpeaker display name
isFinalbooleanWhether this is a final transcription (vs interim)
timestampstringISO timestamp

Note

Only plugins with @events transcript:segment receive transcript data. This avoids serialization overhead for plugins that don't need it.