For the complete documentation index, see llms.txt. This page is also available as Markdown.

πŸ“œLLM Guide

Drop this in an LLM's context window when you want it to generate vcon-js code.

This guide gives a Large Language Model everything it needs to generate spec-compliant code against vcon-js 0.4.0.

Spec target: draft-ietf-vcon-vcon-core-02 Β· syntax parameter "vcon": "0.4.0" Β· library version 0.4.0.

Non-negotiable rules

If you violate any of these, the output is not a valid vCon. Apply them every time:

  1. Syntax param. Every vCon must have vcon: "0.4.0". Vcon.buildNew() sets this automatically β€” do not override.

  2. Field names.

    • Top-level: amended (NOT appended).

    • Critical extensions: addCriticalExtension(name) writes to critical[] / must_understand[]. Do NOT emit must_support.

  3. Attachments use purpose (REQUIRED). The single exception is the Lawful Basis extension, which uses type: "lawful_basis".

  4. Analysis requires vendor. Always set vendor. Use schema (URL or identifier) to declare the body format. Never write schema_version.

  5. Bodies are strings. When encoding: 'json', the body value is a JSON.stringify(...) string, not a JS object.

  6. External media needs both url and content_hash. The hash is sha512-<base64url>.

  7. Timestamps are ISO 8601 with timezone. Use new Date().toISOString() or an explicit offset; never bare local time.

  8. Don't emit empty group: [] or redacted: {}. group is reserved; omit it unless populated.

Public API at a glance

Vcon β€” buildNew(), buildFromJson(json), addParty(), addDialog(), addAttachment(), addAnalysis(), addTag(key, value), addExtension(name), addCriticalExtension(name), toJson(), toDict().

Party β€” identifiers: tel, sip, mailto, stir, did; descriptive: name, role, validation, civicaddress, timezone, meta.

Dialog β€” type: 'recording' | 'text' | 'transfer' | 'incomplete'; required start, parties; inline body + encoding OR external url + content_hash.

Attachment β€” required purpose, party, dialog. Lawful Basis exception uses type.

Analysis is a type, not a class β€” pass a plain object to addAnalysis(). Required: type and vendor.

Canonical end-to-end example

Common bugs in generated code (avoid)

  • ❌ vcon.addAttachment({ type: 'transcript', ... }) β€” wrong; transcripts live in analysis[]. Use addAnalysis.

  • ❌ vcon.addAttachment({ purpose: 'lawful_basis', ... }) β€” wrong; lawful_basis uses type.

  • ❌ body: { transcript: ... } paired with encoding: 'json' β€” body must be a string. Use JSON.stringify.

  • ❌ Emitting appended: { uuid: '...' } or must_support: [...] β€” use amended and critical[] (via addCriticalExtension).

  • ❌ start: '2026-05-18 14:00:00' (no timezone) β€” use .toISOString().

  • ❌ External media without content_hash β€” both url and content_hash are required for external media.

Where to find extension shapes

The vcon-js library does not include per-extension helpers in 0.4.0. When asked to add extension data, refer to the corresponding page in the Extensions section for the exact JSON shape, then construct an attachment or analysis entry matching that shape.

See also

Last updated

Was this helpful?