Skip to content

Update to vcon-core-01 compliance#5

Merged
howethomas merged 4 commits intomainfrom
clever-kepler
Dec 13, 2025
Merged

Update to vcon-core-01 compliance#5
howethomas merged 4 commits intomainfrom
clever-kepler

Conversation

@howethomas
Copy link
Copy Markdown
Contributor

@howethomas howethomas commented Dec 12, 2025

Summary

  • Updated library to be fully compliant with IETF draft-ietf-vcon-vcon-core-01
  • Added comprehensive type definitions and validation
  • Added 3 tutorial examples demonstrating real-world usage
  • Expanded test coverage to 61 tests
  • Bumped version to 0.2.0

Changes

Core Library

  • types.ts: Full vcon-core-01 interfaces (DialogType, DialogDisposition, Encoding, SessionId, etc.)
  • Dialog: New constants (DIALOG_TYPES, DISPOSITIONS, VALID_ENCODINGS), validation method
  • Attachment: Params-based constructor, external/inline data methods, validation
  • Party: Added sip, did, timezone fields; hasIdentifier(), getPrimaryIdentifier(), validate()
  • Vcon: Extension support (addExtension, addCriticalExtension), groups, enhanced API

Documentation

  • Complete API reference in README.md
  • CLAUDE.md for AI assistant instructions
  • 3 tutorial examples: text-chat, call-recording, video-conference

Breaking Changes

  • Encoding type: only 'base64url', 'json', 'none' (removed 'base64')
  • Attachment constructor: now takes params object
  • Dialog types: 'recording', 'text', 'transfer', 'incomplete'

Test plan

  • All 61 tests passing (npm test)
  • Build succeeds (npm run build)
  • All 3 examples run successfully (npm run examples)

🤖 Generated with Claude Code


Note

Implements full vcon-core-01 compliance across types and classes with validation and extension support, updates APIs (incl. attachments), adds 3 examples, expands tests, docs, and bumps version to 0.2.0.

  • Core compliance and types
    • Overhaul src/types.ts to vcon-core-01 (DialogType, DialogDisposition, SessionId, refined Encoding, Group, redaction/amendment, etc.).
    • Export new types/constants via src/index.ts (incl. VCON_VERSION).
  • Classes and API
    • Dialog: adds DIALOG_TYPES, DISPOSITIONS, VALID_ENCODINGS, new fields (mediatype, content_hash, session_id, etc.), addExternalData/addInlineData, type-check helpers, and validate().
    • Attachment: switch to params-based constructor; support purpose, dialog refs, external/inline data helpers, VALID_ENCODINGS, and validate().
    • Party: adds identifiers (sip, did), timezone, helpers hasIdentifier(), getPrimaryIdentifier(), validate(); PartyHistory accepts Date|string and adds fromDict().
    • Vcon: RFC3339 timestamps, vcon defaults to VCON_VERSION, extension APIs (addExtension, addCriticalExtension, hasExtension, isCriticalExtension), addGroup, enhanced addAnalysis/addAttachment, updated getters/setters.
  • Breaking changes
    • Encoding: only base64url, json, none (drops base64).
    • Attachment constructor now accepts a params object.
    • Dialog types standardized to recording|text|transfer|incomplete and mediatype replaces mimetype usage.
  • Docs and examples
    • Expanded README with API reference, compliance notes, and usage; add CLAUDE.md.
    • Add examples: examples/01-text-chat.ts, 02-call-recording.ts, 03-video-conference.ts; new npm scripts to run them.
  • Tests
    • Update and expand Jest tests for dialogs, attachments, parties, vcon behavior (validation, encodings, extensions, groups, timestamps).
  • Version
    • Bump package to 0.2.0.

Written by Cursor Bugbot for commit d6d344b. Configure here.

howethomas and others added 3 commits December 12, 2025 18:49
- Update types.ts with full vcon-core-01 interfaces (DialogType, DialogDisposition, Encoding, etc.)
- Update Dialog class with DIALOG_TYPES, DISPOSITIONS, VALID_ENCODINGS constants
- Update Attachment class with new params-based constructor and validation
- Update Party class with sip, did, timezone fields and validation methods
- Update Vcon class with extension support, groups, and enhanced API
- Add comprehensive tests for all new features (61 tests passing)
- Add 3 tutorial examples: text-chat, call-recording, video-conference
- Update README.md with complete API reference and tutorials
- Add CLAUDE.md for AI assistant instructions

Breaking changes:
- Encoding type now only allows 'base64url', 'json', 'none' (not 'base64')
- Attachment constructor now takes params object instead of positional args
- Dialog type values are now 'recording', 'text', 'transfer', 'incomplete'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment @cursor review or bugbot run to trigger another review on this PR

Comment thread src/party.ts
*/
getPrimaryIdentifier(): string | undefined {
return this.tel || this.sip || this.mailto || this.did || this.uuid;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing stir in getPrimaryIdentifier method

The getPrimaryIdentifier() method returns this.tel || this.sip || this.mailto || this.did || this.uuid but omits this.stir, while hasIdentifier() includes stir in its check. This inconsistency means a party with only a stir identifier will return true for hasIdentifier() but undefined for getPrimaryIdentifier().

Fix in Cursor Fix in Web

Comment thread src/vcon.ts
this.data.critical.push(name);
this.addExtension(name);
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Critical extension addition skips updating timestamp

The addCriticalExtension method pushes to the critical array and then calls addExtension(name). However, if the extension already exists in the extensions array, addExtension returns early without updating updated_at. This means when promoting an existing extension to critical status, the critical array is modified but the updated_at timestamp is not updated, breaking modification tracking.

Fix in Cursor Fix in Web

- Remove duplicate Encoding type definition (kept vcon-core-01 compliant version)
- Restore Redacted interface for redaction references
- Restore Amended interface for amendment references
- VCON_VERSION constant already restored in previous commit

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@howethomas howethomas merged commit ee9001a into main Dec 13, 2025
2 checks passed
@howethomas howethomas deleted the clever-kepler branch December 13, 2025 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant