Vigie
Definitions

Log renderers

defineLogRenderer turns a namespace of fields into a readable section, a phrase in log rows, and a sentence for agents.

A wide event can carry dozens of fields. A log renderer claims a namespace, such as parcelo.*, and says how to show it.

definitions/renderers/parcelo.ts
import { defineLogRenderer, ui } from 'vigie/sdk'

export const parcelo = defineLogRenderer({
  id: 'parcelo',
  match: 'parcelo.*',
  title: 'Parcelo',
  render: (e) => [
    ui.numbers({
      tracked: e.num('parcelo.parcelsTracked'),
      delivered: e.num('parcelo.parcelsDelivered'),
      unmatched: { value: e.num('parcelo.parcelsUnmatched'), tone: e.num('parcelo.parcelsUnmatched') ? 'warn' : 'neutral' },
    }),
    ui.fields(e, 'parcelo.', { hide: /parcels/, tones: { refused: 'error', rate_limited: 'warn' } }),
  ],
  row: (e) => (e.has('parcelo.parcelsTracked') ? `${e.num('parcelo.parcelsTracked')} parcels tracked` : null),
  text: (e) => `Parcelo ${e.str('parcelo.operation')}: ${e.str('parcelo.outcome')}`,
})
FieldWhat it does
matchA field namespace. Matched fields leave the generic "other fields" list.
whenOptional. Render only when it returns true.
renderThe section in the event panel, as a list of ui blocks.
rowA short phrase shown in log rows. Return null for none.
textPlain text for MCP, Slack and AI prompts.

Reading the event

e reads flattened attributes: e.str(key), e.num(key), e.bool(key), e.has(key), e.keys(prefix), and e.attrs for everything.

Blocks

ui.text, ui.inline, ui.stack, ui.section, ui.numbers, ui.kv, ui.fields, ui.table, ui.badge, ui.duration, ui.bytes, ui.httpStatus, ui.code, ui.sql, ui.json, ui.callout, ui.meter. Links open the right screen: link.task(id), link.trace(id), link.person(id), link.account(id), link.process(id), link.route(id), link.page(id), link.url(href).

Tones are neutral, ok, warn, error, brand and muted.

Copyright © 2026